Open6
GitHubのTrendsから知らないリポジトリを起動する

さっきtwitterで「GitHub Trendsの上から順に起動してけば勉強になる」的な話を見たのでとりあえずやり始める

これ起動する
.devcontainger/devcontainer.json
を定義してコンテナ起動
{
//pythonのdevcontainerの設定
"image": "mcr.microsoft.com/devcontainers/python:3.11",
"remoteUser": "root",
"postCreateCommand": "pip install -r requirements.txt"
}
なんかrequirements.txtのバージョン指定でエラーが出たので修正
opencv-python==4.7.0.72
onnx==1.14.0
onnxruntime==1.17.0 # ←ここを1.15.0から変更
numpy==1.24.3
gradio==3.38.0
fastapi
loguru
とりあえずinstallできた

python app.py
したら ImportError: libGL.so.1: cannot open shared object file: No such file or directory
って言われた
のでとりあえずこうしてみる
{
//pythonのdevcontainerの設定
"image": "mcr.microsoft.com/devcontainers/python:3.11",
"remoteUser": "root",
"postCreateCommand": "pip install -r requirements.txt && apt-get update && apt-get install -y ffmpeg libsm6 libxext6"
}

実行したら
onnxruntime.capi.onnxruntime_pybind11_state.NoSuchFile: [ONNXRuntimeError] : 3 : NO_SUCHFILE : Load model from /workspaces/HivisionIDPhotos/hivision_modnet.onnx failed:Load model /workspaces/HivisionIDPhotos/hivision_modnet.onnx failed. File doesn't exist
と言われた。onnxファイルの名前がダウンロードしたまま Hivision Modnet V1.0.onnx
になってたけど、hivision_modnet.onnx
にしなきゃいけなかった。ので名前変更

言語があれだけど起動はできたし、exampleで動いた(この写真exampleで良いのか...?)

色々試してここに落ち着いた
{
//pythonのdevcontainerの設定
"image": "mcr.microsoft.com/devcontainers/python:3.11",
"remoteUser": "root",
"postCreateCommand": "apt-get update && apt-get install -y cmake ffmpeg libsm6 libxext6 && pip install -r requirements.txt",
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"intellsmi.comment-translate"
],
"settings": {
"commentTranslate.hover.enabled": true
}
}
}
}