Replies: 2 comments
-
👋 Hello @surfmore, thank you for sharing your scenario and for your interest in Ultralytics 🚀! It sounds like a fascinating application you're working on. To better assist you, here are a few suggestions and guidelines: If this is a 🐛 Bug Report, we’d kindly ask you to provide more details, such as a minimum reproducible example (MRE). This will help us in replicating the issue you are experiencing with YOLO's predictions and diagnosing potential problems. If this is a ❓ Question about custom training, fine-tuning, or deployment, please include additional context about your dataset, annotations, model configuration, and any modifications made. This will support a more thorough analysis of your case. You can also review our Tips for Best Training Results to ensure optimal performance. We also recommend ensuring you're using the latest version of the pip install -U ultralytics Potential Factors and Improvements
ResourcesFeel free to explore the following:
Status CheckEnsure all Ultralytics CI tests are passing in your environment (badge below). Any deviations might hint at wider compatibility issues: Our engineering team will review this thread soon to provide further assistance. In the meantime, try out these suggestions and let us know how it goes! 😊 |
Beta Was this translation helpful? Give feedback.
-
@surfmore thank you for sharing your details. For improved vehicle tracking consistency in crowded scenes, consider these adjustments:
For commercial deployments requiring reliable performance, see our Enterprise License options at https://ultralytics.com/license. The YOLO team appreciates your feedback! |
Beta Was this translation helpful? Give feedback.
-
Hello,
I have a friend that asked me help to measure the time the cars take to fill their tank in a gas station.
I am using the sample code from the repositories that counts the objects in specific regions.
My issue is that Yolo can idenfify the car inside the area, as in the attached screenshots, but sometimes it says it is a truck, sometimes it says it is a car, sometimes it says there is nothing in the area and sometimes that there are 2 cars. And all this with the car stoped in front of the pump. The issue I believe is that there are people walking around that confuses the model, as well as another car arrives besides it in the other side of the pump and mess up with it.
Could anyone help me to make sure the model count the objects correctly in each of the pumps sides and measure the time each car is stopped there? Is this the best way to use Yolo for this purpose?
I really appreciate your help.
![Captura de tela 2025-02-03 191516](https://private-user-images.githubusercontent.com/8063226/409307108-c9f23c63-437e-4205-a348-a9ce551ae214.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzODEyNzEsIm5iZiI6MTczOTM4MDk3MSwicGF0aCI6Ii84MDYzMjI2LzQwOTMwNzEwOC1jOWYyM2M2My00MzdlLTQyMDUtYTM0OC1hOWNlNTUxYWUyMTQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTJUMTcyMjUxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZGI2YTAxYmQxZGU3ZTNkODA1ZTdlMmJkYjNkZmQ0Njg3ODEzMDVlODExZTgxODM2MzdhZmY1MGY0Nzg5ZDA2NSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.EmC80By9mMk5-YQZ9HUehxoqfeJZ3URJFdourbNbgTg)
![Captura de tela 2025-02-03 191446](https://private-user-images.githubusercontent.com/8063226/409307114-1d04451f-88c7-47d9-bc22-26333824e5c7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzODEyNzEsIm5iZiI6MTczOTM4MDk3MSwicGF0aCI6Ii84MDYzMjI2LzQwOTMwNzExNC0xZDA0NDUxZi04OGM3LTQ3ZDktYmMyMi0yNjMzMzgyNGU1YzcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTJUMTcyMjUxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OGZlYzRhMWFmMDI4MTJlNjRiOGY3YjZmZDA4NzBlYzEwYjk3ZWI4NDNmNDI5NDkzYjA4ZmRkNWQ5MjBkZjk0YSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.ZC2zq8PqLBo_L7mGEB7f1DnhzbDX2vAJGtd1RAOVMmQ)
![Captura de tela 2025-02-03 191353](https://private-user-images.githubusercontent.com/8063226/409307117-afe000b7-f25f-4201-9350-34f7a0951db7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzODEyNzEsIm5iZiI6MTczOTM4MDk3MSwicGF0aCI6Ii84MDYzMjI2LzQwOTMwNzExNy1hZmUwMDBiNy1mMjVmLTQyMDEtOTM1MC0zNGY3YTA5NTFkYjcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTJUMTcyMjUxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjNkMjAxMzVkYmUwM2I0YzllMTc5ZDhmZjFkMjA2MDVkMWRlMjE1NWJhMTE5YmE2YTU1NzEwMWFiZThjNjNkOCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.ylrojlfom7u2B5h129JsdRLY3-pnB-6tfVjM9y5ORms)
![Captura de tela 2025-02-03 191206](https://private-user-images.githubusercontent.com/8063226/409307118-2d8b682f-a066-4d70-a19a-049cb12540d1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzODEyNzEsIm5iZiI6MTczOTM4MDk3MSwicGF0aCI6Ii84MDYzMjI2LzQwOTMwNzExOC0yZDhiNjgyZi1hMDY2LTRkNzAtYTE5YS0wNDljYjEyNTQwZDEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTJUMTcyMjUxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Njk3MDBlODcxZmFmNGNkYTIwYmVjODI3NmM1M2RjY2YwNWQ3YzIxYmM0ZmFjY2M1OGM1OWE0ZGY0OTNiNGE0NSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.iu2HoKq4-6epDaZmFZZiDKZmRpRh9hJdU6b8K8j_FGA)
The full video with the model edition is bellow
https://drive.google.com/file/d/1DARCbo8dlIXayRvwxComiACSZcLSwhon/view?usp=sharing
And bellow is the code I used
`import cv2
from ultralytics import solutions
cap = cv2.VideoCapture("videos/2.mp4")
assert cap.isOpened(), "Error reading video file"
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
Define region points
region_points = [(427, 211), (480, 207), (482, 222), (433, 225)] # Pass region as list
# pass region as dictionary
region_points = {
"region-01": [(50, 50), (250, 50), (250, 250), (50, 250)],
"region-02": [(640, 640), (780, 640), (780, 720), (640, 720)],
}
Video writer
video_writer = cv2.VideoWriter("region_counting.avi", cv2.VideoWriter_fourcc(*"mp4v"), fps, (w, h))
Init RegionCounter
region = solutions.RegionCounter(
show=True,
region=region_points,
classes=[2, 3, 5, 7],
model="yolo11x.pt",
)
Process video
while cap.isOpened():
success, im0 = cap.read()
if not success:
print("Video frame is empty or video processing has been successfully completed.")
break
im0 = region.count(im0)
video_writer.write(im0)
cap.release()
video_writer.release()
cv2.destroyAllWindows()`
Beta Was this translation helpful? Give feedback.
All reactions