Skip to content

Commit

Permalink
starting the setup thing
Browse files Browse the repository at this point in the history
  • Loading branch information
kauevestena committed Dec 24, 2023
1 parent 134a48a commit 0ce8b46
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
32 changes: 32 additions & 0 deletions SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Runing pytorch docker image:

docker run --name langsam_pytorch --gpus all -it pytorch/pytorch:latest

## Inside the container:

- after opening the container (I Recommend using vscode), clone the repository (using this fork):

git clone https://github.com/kauevestena/lang-segment-anything.git

cd lang-segment-anything

( or launch VScode on it)

# Troubleshooting "ImportError: libGL.so.1: cannot open shared object file: No such file or directory":

apt update
apt install libgl1-mesa-glx -y
apt install ffmpeg libsm6 libxext6 -y
apt install libglib2.0-0 -y


Notice that generally inside the container you'll already have sudo already

# Install python requirements:

python -m pip install -r requirements.txt

# Test if everything os working:

python running_test.py

2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
groundingdino-py
segment-anything-py
9 changes: 9 additions & 0 deletions running_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from PIL import Image
from lang_sam import LangSAM

model = LangSAM()
image_pil = Image.open("./assets/car.jpeg").convert("RGB")
text_prompt = "wheel"
masks, boxes, phrases, logits = model.predict(image_pil, text_prompt)

print('all ok')

0 comments on commit 0ce8b46

Please sign in to comment.