modes/predict/ #7932
Replies: 148 comments 350 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.
-
Hi guys, I have a situation and I'm wondering if anyone can help with it. I have a Yolov8 model exported to tflite using the command
I used two predict functions: Predict function 1: Using the YOLO predict function from ultralytics
This function generates a txt file with the predictions, bounding boxes coordinates, and confidence scores. Predict function 2: I used the tflite_runtime interpreter. With this method, I applied the pre-processing (using padding) as recommend by ultralytics. I then pass the pre-processed model to the tflite model (using the invoke function), and the post-processed the results using NMS and finally scale the boxes to fit the original image size.
I get very good bounding boxes with the correct classes for both predict functions. However, the predictions are not the same for all images. Sometimes predict function 1 gives more predictions than function 2 and vice-versa. My expectation is that the predictions from both predict function should be equal for any image since it's same tflite model. Am I missing something? |
Beta Was this translation helpful? Give feedback.
-
import torch class ObjectDetection :
I write all the code as shown in the video but nothin happened ObjectDetection(0) |
Beta Was this translation helpful? Give feedback.
-
Raspberry Pi 5 Error Message Computation completes successfully on Raspberry Pi 5 Model B Rev 1.0 running (RPi) Debian GNU/Linux 12 (bookworm) aarch64. IDE is PyCharm Community Edition 2024.2.3. Code snippet is the first example in this article above. Message originates probably in the call to teh basic statement: Not an issue (results entity is fully complete, of course!) but perhaps worthy of attention for a low-priority minor fix in a future upgrade. Thanks. Regards. |
Beta Was this translation helpful? Give feedback.
-
results object drill-down question: |
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.
-
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