Comments (4)
π Hello @emilio-balda, thank you for your interest in Ultralytics YOLOv8 π! We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered.
If this is a π Bug Report, please provide a minimum reproducible example to help us debug it.
If this is a custom training β Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.
Join the vibrant Ultralytics Discord π§ community for real-time conversations and collaborations. This platform offers a perfect space to inquire, showcase your work, and connect with fellow Ultralytics users.
Install
Pip install the ultralytics
package including all requirements in a Python>=3.8 environment with PyTorch>=1.8.
pip install ultralytics
Environments
YOLOv8 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
- Notebooks with free GPU:
- Google Cloud Deep Learning VM. See GCP Quickstart Guide
- Amazon Deep Learning AMI. See AWS Quickstart Guide
- Docker Image. See Docker Quickstart Guide
Status
If this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit.
from ultralytics.
Hi there,
Thank you for bringing this to our attention and for providing a detailed report along with a reproducible example! This is very helpful. π
It appears that the issue stems from the URL lacking a file extension, which causes the library to misinterpret it as a webcam stream. This is indeed a bug that we need to address.
Before we proceed, could you please confirm that you are using the latest versions of both torch
and ultralytics
? You can update your packages using the following commands:
pip install --upgrade torch ultralytics
Once updated, please try running your script again to see if the issue persists. If it does, we will investigate further.
In the meantime, as a workaround, you might consider downloading the image locally and then running the inference on the local file. Hereβs a quick example of how you could do this:
import requests
from ultralytics import YOLO
# Load a pretrained YOLOv8n model
model = YOLO("yolov8n.pt")
# Download the image
url = "https://figma-alpha-api.s3.us-west-2.amazonaws.com/images/be2cf638-7d2b-46f6-ab89-05be842adf78"
response = requests.get(url)
with open("temp_image.jpg", "wb") as file:
file.write(response.content)
# Run inference on the downloaded image
results = model("temp_image.jpg") # list of Results objects
# Display results
results[0].show()
This should help you continue your work while we look into a more permanent fix for the URL handling issue.
Thank you for your patience and for contributing to the improvement of our library. If you have any further questions or updates, please feel free to share them here.
from ultralytics.
Hi,
The issue happened on the sever side when using Ultralytics HUB. So the Ultralytics & Torch versions are the ones in Ultralytics' infraestructure.
You can replicate the error like this
curl -X POST "https://api.ultralytics.com/v1/predict/<your-model-id>" \
-H "Content-Type: multipart/form-data" \
-H "x-api-key: <your-api-key>" \
-F "size=640" \
-F "confidence=0.25" \
-F "iou=0.45" \
-F "url=https://figma-alpha-api.s3.us-west-2.amazonaws.com/images/be2cf638-7d2b-46f6-ab89-05be842adf78)"
The code snippet I provided is a way to replicate the issue locally. I originally ran it with these versions:
ultralytics 8.2.28
torch 2.3.0
I just upgraded those libraries to their latest versions and I can confirm that the issue persists.
I can see where the issue is coming from, on the main
branch of Ultralytics' GitHub repository. It is here
ultralytics/ultralytics/data/build.py
Line 153 in f92bd9d
from ultralytics.
@emilio-balda hi there,
Thank you for the detailed follow-up and for providing the cURL command to replicate the issue on the Ultralytics HUB. This is very helpful! π
I understand that the issue occurs on the server side when using the Ultralytics HUB Inference API. Given that you've already confirmed the bug persists with the latest versions of ultralytics
and torch
, we'll need to investigate further.
The problem seems to be related to how URLs without file extensions are handled, causing the library to misinterpret them as webcam streams. This indeed appears to be a bug in the URL handling logic.
To help us address this issue more effectively, I've noted the specific line in the codebase that you mentioned:
ultralytics/ultralytics/data/build.py
Line 153 in f92bd9d
We will look into this and work on a fix. In the meantime, as a temporary workaround, you might consider downloading the image locally and running the inference on the local file, as shown in the earlier example.
Thank you for your patience and for bringing this to our attention. If you have any further questions or updates, please feel free to share them here. We appreciate your support in improving our library!
from ultralytics.
Related Issues (20)
- How can i plot the loss and mAP diagram after training yolov8 ? HOT 2
- YOLOv10 NCNN export HOT 2
- segmentation HOT 1
- unexpected freezed layer HOT 4
- KeyError When Customization to YOLOv8 Model: HOT 4
- YOLOv10 export: Setting simplify=True raise exception HOT 7
- TensorFlow & tflite Export Not Working HOT 5
- Different result between v8.1.2 and v8.2 on same dataset HOT 4
- RT-DETR load other pretrained weights HOT 2
- broken hub link HOT 1
- GFLOPs value not showing in summary HOT 6
- How to Optimize YOLOv8 Preprocessing and Postprocessing Time? HOT 1
- On the issue of adding a CBAM attention mechanism HOT 1
- On the issue of adding a CBAM attention mechanism HOT 1
- YOLOv8 Inference Time Increases from Stable 1ms to 15ms over Continuous Runs HOT 1
- Filter small objects when validating HOT 2
- Integration of SCINet with YOLOv8 for Low-Light Object Detection HOT 5
- YOLOV8 and ONNX Support HOT 1
- custom dataset trained model not able to be open in yolov8 HOT 3
- The value of the model.val is incorrect HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ultralytics.