Replies: 1 comment
-
@mannaei77 hello! To count pedestrians and remove the bounding boxes and labels, you can modify your code to use the predictions from the YOLOv8 model without drawing the boxes. You can access the predictions directly from the model's output and count the instances of the 'pedestrian' class. Regarding improving accuracy during training, increasing the number of epochs can potentially lead to a better model, but it's not guaranteed. It's important to monitor the validation loss to ensure that the model is not overfitting. Additionally, consider experimenting with different hyperparameters, augmentations, and using a more diverse dataset. Make sure to refer to the Train documentation for more detailed guidance on training your model effectively. For the pedestrian count without drawing boxes, you can use the Remember to check the Predict documentation for more information on how to use the model for predictions without drawing the bounding boxes. Keep in mind that for specific help with code, you might want to refer to the Ultralytics Docs or seek community support on the GitHub discussions for the repo. Good luck with your project! 😊 |
Beta Was this translation helpful? Give feedback.
-
greetings
I have been having issues with the code below ,i need it to show the pedestrian count and remove the boxes and labels with no success we have trained ultralytics data set on visdrone using yolov8x and was trained on local machine, part two of the question is how to increase the accuracy during training. I have epoch set to 100 if we increase it to 200 or 500 will i get better trained model.i am using thonny IDE
please Advise
import cv2
import cvlib as cv
import pandas as pd
import numpy as np
from vidgear.gears import CamGear
from cvlib.object_detection import draw_bbox
from ultralytics import YOLO
model = YOLO('visdrone_last.pt')
stream = CamGear(source='https://www.youtube.com/watch?v=RQA5RcIZlAM', stream_mode=True, logging=True).start() # YouTube Video URL Video URL as input
my_file = open("coco.txt", "r")
data = my_file.read()
class_list = data.split("\n")
print(class_list)
count = 0
while True:
stream.release()
cv2.destroyAllWindows()
Beta Was this translation helpful? Give feedback.
All reactions