Error when running with transformers.
OSError: It looks like the config file at '/root/.cache/huggingface/hub/models--microsoft--OmniParser-v2.0/snapshots/09fae83e39987d4c19e676253380033a0603dbc3/config.json' is not a valid JSON file.
Same
same issue
+1
+1
same here
Hi everyone, I got it running on my MacBook using this script:
from ultralytics import YOLO
from huggingface_hub import hf_hub_download
# Download the model
model_path = hf_hub_download(
repo_id="microsoft/OmniParser-v2.0",
filename="icon_detect/model.pt",
repo_type="model"
)
# Load the model
model = YOLO(model_path)
# Run inference on an image
results = model("test_image.jpg")
# Print detections
for r in results:
for box in r.boxes:
confidence = box.conf.item()
coords = box.xyxy[0].tolist()
print(f"Detected icon with confidence {confidence:.3f} at location {coords}")
ensure you have requirements.txt with the following:
torch>=2.0.0
ultralytics
huggingface-hub
or simply run: pip install torch>=2.0.0 ultralytics huggingface-hub
Additionally, ensure you are using virtual environment:
On Windows:
python -m venv venv
venv\Scripts\activate
On macOS/Linux:
python3 -m venv venv
source venv/bin/activate
Once done, you can run the script with this command: python simple_detect.py
Don't forget to replace test_image.jpg
in the script with the image name you want to detect elements on!
Note that this will only output the text, you can further modify the code to show the bounding boxes according to your needs.
OSError: It looks like the config file at '/root/.cache/huggingface/hub/models--microsoft--OmniParser-v2.0/snapshots/09fae83e39987d4c19e676253380033a0603dbc3/config.json' is not a valid JSON file.
+1
+1
plus one!!!!!!¡¡¡¡¡¡¡¡¡¡¡¡ I want to use this model to hack the world😎😎😎😎 Lets go baby!!!!!!!