Yolov8 people count

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
frame = stream.read()
count += 1
if count % 5 != 0:
continue

frame = cv2.resize(frame, (1020, 600))
bbox, label, conf = cv.detect_common_objects(frame)
frame = draw_bbox(frame, bbox, label, conf)

Object counting

car_count = label.count(‘car’)
pedestrian_count = label.count(‘pedestrian’)
person_count = label.count(‘person’)
truck_count = label.count(‘truck’)
m_cycle_count = label.count(‘motorcycle’)

cv2.putText(frame, f’Cars: {car_count}‘, (30, 480), cv2.FONT_HERSHEY_PLAIN, 2, (255, 255, 255), 2)
cv2.putText(frame, f’People: {person_count}’, (30, 510), cv2.FONT_HERSHEY_PLAIN, 2, (255, 255, 255), 2)
cv2.putText(frame, f’Trucks: {truck_count}‘, (30, 544), cv2.FONT_HERSHEY_PLAIN, 2, (255, 255, 255), 2)
cv2.putText(frame, f’Motorcycles: {m_cycle_count}’, (30, 574), cv2.FONT_HERSHEY_PLAIN, 2, (255, 255, 255), 2)
cv2.putText(frame, f’Pedestrians: {pedestrian_count}', (30, 400), cv2.FONT_HERSHEY_PLAIN, 2, (255, 255, 255), 2)

results = model.predict(frame, show=True)

if cv2.waitKey(1) & 0xFF == 27:
break