From e89601d83552c0bd21f8f9a031c00e18b6dd16ff Mon Sep 17 00:00:00 2001 From: yubbit Date: Thu, 18 Jun 2026 16:53:14 +0800 Subject: [PATCH] Fix Docker scripts for muggled-sam --- muggled-sam/Dockerfile | 9 ++++++--- muggled-sam/commands | 1 + muggled-sam/docker-compose.yml | 3 +++ muggled-sam/download-model-weights.bat | 1 - muggled-sam/muggled_sam | 2 +- muggled-sam/run-muggled-sam.bat | 2 +- muggled-sam/run-notebook.bat | 1 + 7 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 muggled-sam/commands delete mode 100644 muggled-sam/download-model-weights.bat create mode 100644 muggled-sam/run-notebook.bat diff --git a/muggled-sam/Dockerfile b/muggled-sam/Dockerfile index 06451a5..76e4f21 100644 --- a/muggled-sam/Dockerfile +++ b/muggled-sam/Dockerfile @@ -1,8 +1,11 @@ -FROM pytorch/pytorch:2.6.0-cuda12.6-cudnn9-runtime +FROM pytorch/pytorch:2.12.0-cuda13.2-cudnn9-runtime -RUN pip install \ +RUN pip install --break-system-packages --no-cache-dir \ "opencv-python>=4.5,<4.12" \ - "numpy>=1.21,<2.3" + "numpy>=1.21,<2.3" \ + "gradio" \ + "notebook" \ + "matplotlib" RUN apt-get update && apt-get install -y \ ffmpeg \ diff --git a/muggled-sam/commands b/muggled-sam/commands new file mode 100644 index 0000000..dd7cce0 --- /dev/null +++ b/muggled-sam/commands @@ -0,0 +1 @@ +jupyter notebook --allow-root --ip 0.0.0.0 --no-browser --NotebookApp.token='' --NotebookApp.password='' \ No newline at end of file diff --git a/muggled-sam/docker-compose.yml b/muggled-sam/docker-compose.yml index b000dc2..47f461a 100644 --- a/muggled-sam/docker-compose.yml +++ b/muggled-sam/docker-compose.yml @@ -11,6 +11,9 @@ services: - type: bind source: ./muggled_sam target: /workspace/muggled-sam + - type: bind + source: ./notebooks + target: /workspace/muggled-sam/notebooks - type: bind source: ../data/muggled-sam/saved_images target: /workspace/muggled-sam/saved_images diff --git a/muggled-sam/download-model-weights.bat b/muggled-sam/download-model-weights.bat deleted file mode 100644 index d1c3024..0000000 --- a/muggled-sam/download-model-weights.bat +++ /dev/null @@ -1 +0,0 @@ -curl -o "muggled_sam\model_weights\sam2.1_hiera_large.pt" https://dl.fbaipublicfiles.com/segment_anything_2/092824/sam2.1_hiera_large.pt diff --git a/muggled-sam/muggled_sam b/muggled-sam/muggled_sam index 64ee169..ab3c930 160000 --- a/muggled-sam/muggled_sam +++ b/muggled-sam/muggled_sam @@ -1 +1 @@ -Subproject commit 64ee1696347f6f70fa140333dc431caf02eb4feb +Subproject commit ab3c930712c1e55b2644152f18536fb8f5533811 diff --git a/muggled-sam/run-muggled-sam.bat b/muggled-sam/run-muggled-sam.bat index f1cd39a..8a88a10 100644 --- a/muggled-sam/run-muggled-sam.bat +++ b/muggled-sam/run-muggled-sam.bat @@ -1 +1 @@ -docker compose run --rm -it --name muggled_sam muggled_sam \ No newline at end of file +docker compose run -p 8888:8888 -p 7860:7860 --rm -it --name muggled_sam muggled_sam \ No newline at end of file diff --git a/muggled-sam/run-notebook.bat b/muggled-sam/run-notebook.bat new file mode 100644 index 0000000..37fbc2a --- /dev/null +++ b/muggled-sam/run-notebook.bat @@ -0,0 +1 @@ +docker compose run -p 8888:8888 -p 7860:7860 --rm -it --entrypoint "jupyter notebook --allow-root --ip 0.0.0.0 --no-browser --NotebookApp.token='' --NotebookApp.password=''" --name muggled_sam muggled_sam \ No newline at end of file