How to read out put of predict #984
-
Hi, I couldn't find a way to read the pickle things or a way to read the result from predict. Do you guys have any example? thanks This is my current code: `model_type = "yolov8" slice_height = 320 #source_image_dir = "2023-12-22" frame = cv2.imread("2023-12-22/id_313_n_8.jpg") result=predict( print(result)` |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Still have to read from pickle for file_path in file_paths: for detection in data:
` |
Beta Was this translation helpful? Give feedback.
Still have to read from pickle
`
import pickle
import json
import glob
file_paths = glob.glob(f"{result.get('export_dir')}/pickles/*.pickle")
for file_path in file_paths:
with open(file_path, 'rb') as f:
data = pickle.load(f)
# Process the data as needed
for detection in data:
label = detection.category.name
confidence = detection.score.value
bbox = detection.bbox.to_voc_bbox()
`