astrosbd commited on
Commit
a3f47ce
·
1 Parent(s): 5c783e4

Setup Dockerfile and fixed detectron2 installation

Browse files
Files changed (2) hide show
  1. Dockerfile +36 -0
  2. requirements.txt +3 -4
Dockerfile ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Installer les dépendances système nécessaires
4
+ RUN apt-get update && apt-get install -y \
5
+ git \
6
+ gcc \
7
+ g++ \
8
+ build-essential \
9
+ libgl1-mesa-glx \
10
+ libglib2.0-0 \
11
+ python3-dev \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ WORKDIR /app
15
+
16
+ # Copier les dépendances
17
+ COPY requirements.txt /app/requirements.txt
18
+
19
+ # Installer PyTorch (version CPU uniquement)
20
+ RUN pip install --upgrade pip && \
21
+ pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu
22
+
23
+ # Installer Detectron2 depuis GitHub (solution officielle)
24
+ RUN pip install 'git+https://github.com/facebookresearch/detectron2.git'
25
+
26
+ # Installer les autres dépendances
27
+ RUN pip install -r requirements.txt
28
+
29
+ # Copier tout le code dans l'image Docker
30
+ COPY . /app
31
+
32
+ # Exposer le port utilisé par Gradio
33
+ EXPOSE 7860
34
+
35
+ # Commande pour lancer ton app Gradio (modifie selon ton script)
36
+ CMD ["python", "app.py"]
requirements.txt CHANGED
@@ -4,7 +4,6 @@ opencv-python>=4.8.0
4
  numpy>=1.24.0
5
  Pillow>=10.0.0
6
  gradio>=3.50.0
7
- detectron2>=0.6.0; platform_system!="Darwin" # Detectron2 not available for macOS
8
- fvcore>=0.1.5.post20221221; platform_system!="Darwin" # Required for detectron2
9
- iopath>=0.1.9; platform_system!="Darwin" # Required for detectron2
10
- pycocotools>=2.0.6; platform_system!="Darwin" # Required for detectron2
 
4
  numpy>=1.24.0
5
  Pillow>=10.0.0
6
  gradio>=3.50.0
7
+ fvcore>=0.1.5.post20221221; platform_system!="Darwin"
8
+ iopath>=0.1.9; platform_system!="Darwin"
9
+ pycocotools>=2.0.6; platform_system!="Darwin"