You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the EcoAssist and Timelapse integration of video processing results, we need an option to get a video JSON file with detection results for all frames processed.
Now I do it inside EcoAssist like so:
# Load the video recognition JSON fileifvideo_json:
withopen(video_json, 'r') asvideo_file:
video_data=json.load(video_file)
# group the frame-level detections into a their parent videoifre.search(r"frame\d{6}\.jpg", video_data['images'][0]['file']):
aggregated_detections_per_video=defaultdict(list)
forframeinvideo_data['images']:
video=os.path.join(*Path(frame['file']).parts[:-1])
frame_number=int(Path(frame['file']).stem[5:])
detections=frame['detections']
detections=detections[0]
detections['frame_number'] =frame_numberaggregated_detections_per_video[video].append(detections)
new_video_data= []
forvideo, detectionsinaggregated_detections_per_video.items():
new_video_data.append({"file": video, "detections": detections})
video_data['images'] =new_video_data
But it feels quite cumbersome to convert this inside EcoAssist (and error prone), if MegaDetector had removed them earlier. What are you're thoughts about this?
The text was updated successfully, but these errors were encountered:
@PetervanLunteren, does the --include_all_processed_frames option to process_video.py already do what you're looking for?
If you already have a .json file that came from somewhere else, and you want to use the same mechanics, you can use the frame_results_to_video_results function, which is what process_video uses to convert frame-level results to video-level results. It takes an options object that has an include_all_processed_frames option.
Let me know if that already does what you're looking for, or if not, how the behavior you're looking for is different?
Either way, I think we're between 90% and 100% of the way there.
For the EcoAssist and Timelapse integration of video processing results, we need an option to get a video JSON file with detection results for all frames processed.
Now I do it inside EcoAssist like so:
That would result in something like this:
But it feels quite cumbersome to convert this inside EcoAssist (and error prone), if MegaDetector had removed them earlier. What are you're thoughts about this?
The text was updated successfully, but these errors were encountered: