Closed rakeshwar07 closed 1 year ago
Hello, could you please give me more details about this previous version of code? My script is compatible with the latest ultralytics version for now (8.0.43), so I think it should be alright. The only addition to this code is the UI made with streamlit, for a much better user experience.
I really appreciate your work, when I try to run the code I am getting this error "TypeError Traceback (most recent call last) Cell In[2], line 117 91 result_list_json = [ 92 { 93 'class_id': int(result.boxes.cls[idx].cpu().numpy()), (...) 104 }for idx in range(len(result)) 105 ] 106 if tracker is not None: 107 bbs = [ 108 ( 109 [ 110 result_list_json[idx]['bbox']['x_min'], 111 result_list_json[idx]['bbox']['y_min'], 112 result_list_json[idx]['bbox']['x_max'] - result_list_json[idx]['bbox']['x_min'], 113 result_list_json[idx]['bbox']['y_max'] - result_list_json[idx]['bbox']['y_min'] 114 ], 115 result_list_json[idx]['confidence'], 116 result_list_json[idx]['class'], --> 117 )for idx in range(len(result)) 118 ] 119 tracks = tracker.update_tracks(bbs, frame=result.orig_img) 120 for idx in range(len(result_list_json)):
TypeError: 'NoneType' object cannot be interpreted as an integer"
Currently, I am not using streamlit, just testing with an offline video.
Sorry that error is because of the missing "len_results = len(result.boxes)" in the result_to_json method. I saw that you too have updated it. Thank you, I am closing this issue.
, I am trying to work on offline video tracking