IZERE HIRWA Roger commited on
Commit
cb43dd3
·
1 Parent(s): 0ac79d5
Files changed (2) hide show
  1. Dockerfile +6 -1
  2. app.py +1 -1
Dockerfile CHANGED
@@ -10,7 +10,9 @@ ENV DEBIAN_FRONTEND=noninteractive \
10
  # ↓ Hugging Face cache inside the container (optional)
11
  HF_HOME=/opt/hf_cache \
12
  # Set MPLCONFIGDIR to a writable directory
13
- MPLCONFIGDIR=/tmp/matplotlib-cache
 
 
14
 
15
  # ––– OS packages –––
16
  RUN apt-get update && \
@@ -43,5 +45,8 @@ RUN mkdir -p weights && \
43
  wget -q -O weights/groundingdino_swint_ogc.pth \
44
  https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth
45
 
 
 
 
46
  EXPOSE 7860
47
  ENTRYPOINT ["python", "app.py", "--host", "0.0.0.0", "--port", "7860"]
 
10
  # ↓ Hugging Face cache inside the container (optional)
11
  HF_HOME=/opt/hf_cache \
12
  # Set MPLCONFIGDIR to a writable directory
13
+ MPLCONFIGDIR=/tmp/matplotlib-cache \
14
+ # Set Fontconfig cache directory to a writable location
15
+ FONTCONFIG_PATH=/tmp/fontconfig-cache
16
 
17
  # ––– OS packages –––
18
  RUN apt-get update && \
 
45
  wget -q -O weights/groundingdino_swint_ogc.pth \
46
  https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth
47
 
48
+ # Set permissions for the working directory
49
+ RUN chmod 777 /workspace
50
+
51
  EXPOSE 7860
52
  ENTRYPOINT ["python", "app.py", "--host", "0.0.0.0", "--port", "7860"]
app.py CHANGED
@@ -28,7 +28,7 @@ device = torch.device("cpu")
28
  DINO_CKPT = "weights/groundingdino_swint_ogc.pth"
29
  SAM_CKPT = "weights/sam_vit_h_4b8939.pth"
30
 
31
- grounder = GroundingModel(DINO_CKPT, device=device)
32
  sam = sam_model_registry["vit_h"](checkpoint=SAM_CKPT).to(device)
33
  predictor = SamPredictor(sam)
34
 
 
28
  DINO_CKPT = "weights/groundingdino_swint_ogc.pth"
29
  SAM_CKPT = "weights/sam_vit_h_4b8939.pth"
30
 
31
+ grounder = GroundingModel(model_checkpoint_path=DINO_CKPT, device=device)
32
  sam = sam_model_registry["vit_h"](checkpoint=SAM_CKPT).to(device)
33
  predictor = SamPredictor(sam)
34