Closed BadCoder2 closed 5 months ago
After poking around for a bit, I found this which suggests that maybe I have to use an absolute path instead of a relative path - give me a second to see if this fixes the issue
Still getting the same error running docker run -it -p 8080:8080 -v /mydata:/label-studio/data --env LABEL_STUDIO_LOCAL_FILES_SERVING_ENABLED=true --env LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT=C:\\data\\media heartexlabs/label-studio
:(
segment_anything_model | Point coords are [[2040, 1356], [1883, 1408]], point labels are [0, 1], input box is None
segment_anything_model | [2024-06-02 13:20:00,785] [ERROR] [label_studio_ml.exceptions::exception_f::53] Traceback (most recent call last):
segment_anything_model | File "/usr/local/lib/python3.8/site-packages/label_studio_ml/exceptions.py", line 39, in exception_f
segment_anything_model | return f(*args, **kwargs)
segment_anything_model | File "/usr/local/lib/python3.8/site-packages/label_studio_ml/api.py", line 69, in _predict
segment_anything_model | response = model.predict(tasks, context=context, **params)
segment_anything_model | File "/app/model.py", line 51, in predict
segment_anything_model | predictor_results = PREDICTOR.predict(
segment_anything_model | File "/app/sam_predictor.py", line 202, in predict
segment_anything_model | return self.predict_sam(img_path, point_coords, point_labels, input_box, task)
segment_anything_model | File "/app/sam_predictor.py", line 173, in predict_sam
segment_anything_model | self.set_image(img_path, calculate_embeddings=False, task=task)
segment_anything_model | File "/app/sam_predictor.py", line 86, in set_image
segment_anything_model | image_path = get_local_path(
segment_anything_model | File "/usr/local/lib/python3.8/site-packages/label_studio_tools/core/utils/io.py", line 121, in get_local_path
segment_anything_model | raise FileNotFoundError(
segment_anything_model | FileNotFoundError: Can't resolve url, neither hostname or project_dir passed: /data/upload/1/80cf6086-1LookingAwayOrig.JPG. You can set LABEL_STUDIO_URL environment variable to use it as a hostname.
segment_anything_model |
segment_anything_model | Traceback (most recent call last):
segment_anything_model | File "/usr/local/lib/python3.8/site-packages/label_studio_ml/exceptions.py", line 39, in exception_f
segment_anything_model | return f(*args, **kwargs)
segment_anything_model | File "/usr/local/lib/python3.8/site-packages/label_studio_ml/api.py", line 69, in _predict
segment_anything_model | response = model.predict(tasks, context=context, **params)
segment_anything_model | File "/app/model.py", line 51, in predict
segment_anything_model | predictor_results = PREDICTOR.predict(
segment_anything_model | File "/app/sam_predictor.py", line 202, in predict
segment_anything_model | return self.predict_sam(img_path, point_coords, point_labels, input_box, task)
segment_anything_model | File "/app/sam_predictor.py", line 173, in predict_sam
segment_anything_model | self.set_image(img_path, calculate_embeddings=False, task=task)
segment_anything_model | File "/app/sam_predictor.py", line 86, in set_image
segment_anything_model | image_path = get_local_path(
segment_anything_model | File "/usr/local/lib/python3.8/site-packages/label_studio_tools/core/utils/io.py", line 121, in get_local_path
segment_anything_model | raise FileNotFoundError(
segment_anything_model | FileNotFoundError: Can't resolve url, neither hostname or project_dir passed: /data/upload/1/80cf6086-1LookingAwayOrig.JPG. You can set LABEL_STUDIO_URL environment variable to use it as a hostname.
This is like #443 and #355 except the images are already imported using the GUI and it still doesn't work. Any advice?
On a whim I tried docker run -it -p 8080:8080 -v C:\\labelstudiodata:\\label-studio\\data --env LABEL_STUDIO_LOCAL_FILES_SERVING_ENABLED=true --env LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT=C:\\data\\media heartexlabs/label-studio
and that didn't work either unfortunately
Have you tried to set LABEL_STUDIO_URL and LABEL_STUDIO_API_KEY ? I see you used HOST and ACCESS_TOKEN, but it is better to try url and api_key.
WOW that did it! For others who come across this issue, I just changed LABEL_STUDIO_HOST
and LABEL_STUDIO_ACCESS_TOKEN
to LABEL_STUDIO_URL
and LABEL_STUDIO_API_KEY
respectively and it worked first try! Thanks @makseq!
I started my Label Studio container with:
And I started Segment Anything with the following
docker-compose.yml
(with the access token added):Which I then ran with a command prompt, in that directory, with the command of
docker compose up --build
. Everything runs fine with no errors - the model registers and validates fine - but when I go to actually try to do a prediction, the following happens in the SAM docker container and I get no prediction back:I've checked similar issues and I believe this is a new issue (though I may be entirely wrong). Could anyone help me out with this? Thanks so much!!