-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
134a48a
commit 0ce8b46
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
groundingdino-py | ||
segment-anything-py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |