Spaces:
Sleeping
Sleeping
IZERE HIRWA Roger
commited on
Commit
Β·
bc2ee7a
1
Parent(s):
cb43dd3
- Dockerfile +2 -0
- app.py +2 -1
Dockerfile
CHANGED
@@ -48,5 +48,7 @@ RUN mkdir -p weights && \
|
|
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"]
|
|
|
48 |
# Set permissions for the working directory
|
49 |
RUN chmod 777 /workspace
|
50 |
|
51 |
+
RUN mkdir -p /tmp/fontconfig-cache && chmod 777 /tmp/fontconfig-cache
|
52 |
+
|
53 |
EXPOSE 7860
|
54 |
ENTRYPOINT ["python", "app.py", "--host", "0.0.0.0", "--port", "7860"]
|
app.py
CHANGED
@@ -25,10 +25,11 @@ from segment_anything import sam_model_registry, SamPredictor
|
|
25 |
# βββ Load models once βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
26 |
device = torch.device("cpu")
|
27 |
|
|
|
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 |
|
|
|
25 |
# βββ Load models once βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
26 |
device = torch.device("cpu")
|
27 |
|
28 |
+
DINO_CONFIG = "GroundingDINO/groundingdino/config/GroundingDINO_SwinT_OGC.py"
|
29 |
DINO_CKPT = "weights/groundingdino_swint_ogc.pth"
|
30 |
SAM_CKPT = "weights/sam_vit_h_4b8939.pth"
|
31 |
|
32 |
+
grounder = GroundingModel(model_config_path=DINO_CONFIG, model_checkpoint_path=DINO_CKPT, device=device)
|
33 |
sam = sam_model_registry["vit_h"](checkpoint=SAM_CKPT).to(device)
|
34 |
predictor = SamPredictor(sam)
|
35 |
|