EGO4D / hands-and-objects

MIT License
77 stars 9 forks source link

visualization tools? #7

Closed JudyYe closed 2 years ago

JudyYe commented 2 years ago

Hi,

Thank you for your nice work!

I am looking into the bbox annotation and hopes to see some output in the visualization code. However, their repo uses some annotations files "fho.json" that is not in the final release annotations/fho_xxx.json ? When I borrow their code and visualize, it seems that the frame_number are not aligned.....

For now, my way to calculate frame_number for a certain clip in fho_scod_val.json is that 1) treat the ['clips'][0]['pre_frame']['frame_number'] as clip_number (as they are the same) 2) offset it by the clip_start_frame in fho_oscc-pnr_xxx.json indexed by clip_uid But apparently this is not correct.

8ea8bd4d-8778-4a0e-81aa-3f34044ce7ca_0 my visualization

        clip_id = 0
        frame_order = ['pre_45', 'pre_30', 'pre_15', 'pre_frame', 'contact_frame', 'pnr_frame', 'post_frame']

        # step 2
        start = scod_df['clips'][clip_id]['clip_uid']
        clip = [e for e in oscc_df['clips'] if e['clip_uid'] == start][0]
        start = clip['clip_start_frame']

        # step 1
        frames = [scod_df['clips'][clip_id][e] for e in frame_order if e in scod_df['clips'][clip_id]]
        for x in frames:
            x['frame_number'] += start # offset
        fho_video_path = data_dir + '/full_scale/%s.mp4' % vid

        plot_frames_with_bboxes(fho_video_path, frames, fpath=os.path.join(vis_dir, vid + '_%d' % clip_id), key='bbox')    

visualization code

So I kindly request your help on

  1. if you could explain how to interpret frame_number in fho_xxxx.json and how to convert them to global frame_number?
  2. maybe in the long-term, if you could provide a visualization tool as in the dataset introduction repo.

Thank you!

fuqichen1998 commented 2 years ago

The fho.json is the master annotation file, which we plan to release soon.

Other problems mentioned are solved offline, and there is no issue with the annotation files.

JudyYe commented 2 years ago

Thank you for your time Qichen! It is super helpful!

The frame_number is the global frame number. The inconsistency is due to my stupid bug :/