modes/predict/ #7932
Replies: 152 comments 354 replies
-
thx, its amazing |
Beta Was this translation helpful? Give feedback.
-
Can we set different confidences for different classes? It would be a nice addition. |
Beta Was this translation helpful? Give feedback.
-
Can you please share more details on the I understand that by default we receive 160x160 masks in segment models, but what does setting the above True do? |
Beta Was this translation helpful? Give feedback.
-
Hi, I am trying to do a simple yolo model and every time I try predicting it doesn't detect anything. Here is what I am doing. I am. downloading this dataset and then trying to train a model on it and then once its trained I am trying to predict with it. I pasted all of my code so that you can replicate. https://universe.roboflow.com/damage-4yhkc/damaged-bchyj/dataset/5/downloadfrom roboflow import Roboflow model = YOLO('yolov8n-seg.pt') # build from YAML and transfer weights #Predict |
Beta Was this translation helpful? Give feedback.
-
Hello if i want to know these pixel coordinates represent which object, What should i do? For example this is my code
And this code give to me the pixel coordinates of objects so how can i learn which coordinate represents which object? |
Beta Was this translation helpful? Give feedback.
-
With that code :
it print that results: |
Beta Was this translation helpful? Give feedback.
-
how can we count total number of objects in the set of images after training the model? |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for your response. I appreciate it.
I want to know can we use this code for directory because I have 760 images
in the directory I want count the total predicted boxes all in once.
Thanks
…On Tue, Feb 13, 2024, 9:55 PM Glenn Jocher ***@***.***> wrote:
Hey there! 👋 To count the total number of objects across a set of images
after training your model, you can use the predict mode to process your
images and then sum up the detections. Here's a quick example using Python:
from ultralytics import YOLO
# Load your trained modelmodel = YOLO('path/to/your/trained_model.pt')
# List of images to run inference onimages = ['image1.jpg', 'image2.jpg', ...]
# Run inferenceresults = model(images)
# Count total objectstotal_objects = sum(len(result.boxes) for result in results)print(f'Total objects detected: {total_objects}')
This will give you the total count of objects detected across all your
images. Happy counting! 😊
—
Reply to this email directly, view it on GitHub
<#7932 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BAHRMJFIOOEU34WCWMTYWELYTNWFDAVCNFSM6AAAAABCTDRDM6VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DINJUGA2TM>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
If i want to run predictions on several images at once, I shoumd use a tensor as |
Beta Was this translation helpful? Give feedback.
-
If I want to predict on several images at once I should use a tensor with the format |
Beta Was this translation helpful? Give feedback.
-
If I want to predict on several images at once I should use a tensor with the format |
Beta Was this translation helpful? Give feedback.
-
This aint working: Load a pretrained YOLOv8n modelmodel = YOLO('yolov8n.pt') Create a random torch tensor of BCHW shape (1, 3, 640, 640) with values in range [0, 1] and type float32source = torch.rand(1, 3, 640, 640, dtype=torch.float32) Run inference on the sourceresults = model(source) # list of Results objects ERROR:
|
Beta Was this translation helpful? Give feedback.
-
Hello, i export the model (yolov8-seg.onnx), and i use this model in react. how can i take the outline coordinates like 'masks.xy' in react app? |
Beta Was this translation helpful? Give feedback.
-
I want to use YOLOv8 for multi-class image classification but yolov8n-cls have 1k classes which is way more than i want , i want to classify for just <80 class for example if image have Chihuahua and catfish model must return only dog and fish not the specific kind of dogs , how to do that ? |
Beta Was this translation helpful? Give feedback.
-
How to get masks only conf is over 0.8? realtime capture by webcam |
Beta Was this translation helpful? Give feedback.
-
The plotting of results is much easier!!! |
Beta Was this translation helpful? Give feedback.
-
hi, I am facing some issue with streaming for-loop code, I copy as your reference then only change the path of model and video source, but when I run it using python debugger, it shows |
Beta Was this translation helpful? Give feedback.
-
If I am mistaken, has anyone noticed any issues with the code example used for plotting? Specifically, it seems that im_bgr is assigned but not used afterward. If r.show() can directly display the image, why go through the extra steps of creating im_bgr and im_rgb? https://docs.ultralytics.com/modes/predict/#plotting-results |
Beta Was this translation helpful? Give feedback.
-
The only thing that is been shown is yolo 10m summary (fused) :369 layers,
16,543,024 parameters,16,543,008 gradients,63.9 GFLOPs
…On Sun, Oct 20, 2024, 4:54 AM Glenn Jocher ***@***.***> wrote:
@ApodiAlsurihi <https://github.com/ApodiAlsurihi> it seems like there
might be an issue with how the ObjectDetection class is being called.
Ensure that the __call__ method is properly implemented to start the
video capture loop. You might need to instantiate the class and call it
like this: detector = ObjectDetection(0); detector(). If you need further
assistance, please refer to the YOLO predict mode documentation
<https://docs.ultralytics.com/modes/predict/>.
—
Reply to this email directly, view it on GitHub
<#7932 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BCISNNXUHHI67OLZMFMSIVDZ4MEO5AVCNFSM6AAAAABCTDRDM6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAOJZGM4TQNA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
hello,@glenn-jocher,I have a question I'd like to ask. I want to use YOLO to perform inference on a 10-second video clip each time, and this 10-second video clip is constantly being polled and updated. In this case, I need to pass a list to the model, and this list should contain data for 10 seconds, which amounts to 250 frames, assuming a frame rate of 25 fps. After detection is complete, how can I display the detection results in a smooth 10-second video without any lag? Thank you. for i in range(num_channels):
|
Beta Was this translation helpful? Give feedback.
-
Please help me. I've now labeled 9 kinds of data sets myself. But I want to train some of these classes with multiple networks, but it lacks the prompt error. Please help me with this. Errors are as follows。 The above exception was the direct cause of the following exception: Traceback (most recent call last): This is my yolov10n. yaml Parametersnc: 2 # number of classes [depth, width, max_channels]n: [0.33, 0.25, 1024] This is my path file Classesnames: |
Beta Was this translation helpful? Give feedback.
-
I know that you can do "max_det" to specify the max amount of detections in a frame of a video, is it possible to set a max_detect for each class within a frame? For example it sometimes labels the same object with both class names, If i am able to set a max limit of 1 for each class this would not be a problem. Thank you! please get back to me! |
Beta Was this translation helpful? Give feedback.
-
Nice! This is very helpful because I too needed this snippet. Thanks! |
Beta Was this translation helpful? Give feedback.
-
I just want to clarify as my team and myself are trying to fine tune our model, but is this the correct process? As long as detection is a path to our previously trained model and the results with the "data.yml" is the path to our newly annotated images in the spots that is having a hard time in? Just want to clarify so we can make sure to do it correctly. detection = YOLO("runs/detect/train/weights/best.pt") results = detection.train(data="data.yaml", epochs=300, imgsz=640) |
Beta Was this translation helpful? Give feedback.
-
Hi. but the image size won't change into sqaure(640x640) but still works on rectangle(384x640). Thanks |
Beta Was this translation helpful? Give feedback.
-
My understanding is that the IOU here refers to the value of filtering overlapping boxes when NMS. If I want to adjust the IOU value between the predicted box and the gtBox, how can I set it? |
Beta Was this translation helpful? Give feedback.
-
I want to use yolo11n-pose to get key points of hands
it can show keypoints, but I want to draw skeletons and 'kpt_line = True' is not working |
Beta Was this translation helpful? Give feedback.
-
Hi, I am a pharmacist living in Taiwan. I am very glad to work with YOLO due to its fascinating functionality and clear operation. I want to let you know how important it is for me to use YOLO for locating my drug boxes on the shelves. However, I have encountered a problem. I can detect a specific box or all classes of drug boxes in a picture of my shelves, but I can't detect multiple classes (e.g., two or three classes) in the same picture. How can I solve this issue? |
Beta Was this translation helpful? Give feedback.
-
i'm receiving this error while processing videos with model.track OpenCV(4.8.0) /io/opencv/modules/video/src/lkpyramid.cpp:1394: error: (-215:Assertion failed) prevPyr[level * lvlStep1].size() == nextPyr[level * lvlStep2].size() in function 'calc' |
Beta Was this translation helpful? Give feedback.
-
Hi! I solved downgrading opencv-python to 4.6.x. I was using 4.8.0.x
Il giorno gio 19 dic 2024 alle 12:57 Glenn Jocher ***@***.***>
ha scritto:
… @davidetedd9203 <https://github.com/davidetedd9203> the error you're
encountering with OpenCV likely stems from mismatched frame sizes between
consecutive video frames. Please ensure that the input video frames are
consistent in size and format. If the issue persists, consider re-encoding
the video to a standard format using tools like FFmpeg. Let me know if you
need further clarification!
—
Reply to this email directly, view it on GitHub
<#7932 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARILVQEQFUWH5JQHTZE2YHD2GKYDFAVCNFSM6AAAAABCTDRDM6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNRRGY2TSNI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
modes/predict/
Discover how to use YOLOv8 predict mode for various tasks. Learn about different inference sources like images, videos, and data formats.
https://docs.ultralytics.com/modes/predict/
Beta Was this translation helpful? Give feedback.
All reactions