diff --git a/ai/README.md b/ai/README.md index c0cfba8..60fad15 100644 --- a/ai/README.md +++ b/ai/README.md @@ -1,15 +1,22 @@ # FastAPI를 이용한 AI 모델 관련 API -## app +## conda 환경 세팅 +```bash +conda env create -f environment.yml +conda activate worlabel_ai_env +``` -### api -- fastapi 호출 함수 정의 +## FastAPI Project 구조 -### schemas +### app/api +- api 호출 라우터 정의 + +### app/schemas - api의 request/response 등 Pydantic 모델 정의 -### services -- 필요한 ai 서비스들을 정의 +### app/services +- AI 관련 패키지를 이용하는 메서드 정의 + +### app/utils +- 프로젝트 전역에서 이용하는 formatter 등 정의 -### utils -- 프로젝트 전역에서 이용하는 formatter 등 정의 \ No newline at end of file diff --git a/ai/environment.yml b/ai/environment.yml new file mode 100644 index 0000000..ccd77ce --- /dev/null +++ b/ai/environment.yml @@ -0,0 +1,15 @@ +name: worlabel_ai_env +channels: + - conda-forge + - nvidia + - pytorch + - defaults +dependencies: + - python=3.10.10 + - pytorch + - torchvision + - torchaudio + - pytorch-cuda=12.1 + - fastapi + - uvicorn + - ultralytics \ No newline at end of file diff --git a/ai/requirements.txt b/ai/requirements.txt index 2216eb5..a2cb5ad 100644 --- a/ai/requirements.txt +++ b/ai/requirements.txt @@ -1,7 +1,12 @@ fastapi==0.104.1 uvicorn==0.30.6 -torch==2.4.0 -f https://download.pytorch.org/whl/cpu -torchaudio==2.4.0 -f https://download.pytorch.org/whl/cpu -torchvision==0.19.0 -f https://download.pytorch.org/whl/cpu ultralytics==8.2.82 ultralytics-thop==2.0.5 + +--extra-index-url https://download.pytorch.org/whl/cu121 +torch==2.4.0+cu121 +--extra-index-url https://download.pytorch.org/whl/cu121 +torchaudio==2.4.0+cu121 +--extra-index-url https://download.pytorch.org/whl/cu121 +torchvision==0.19.0+cu121 +