File size: 1,094 Bytes
80d9acd 571110a 80d9acd 571110a 80d9acd 571110a 80d9acd 571110a 80d9acd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
import json
import os
import cv2
import pprint
import matplotlib.pyplot as plt
import json
import openai
import os
from openai import OpenAI
def read_json_file(file_path):
with open(file_path, 'r') as json_file:
data = json.load(json_file)
return data
vidstg_data = read_json_file('VidSTG-Dataset/annotations/train_annotations.json')
for record in vidstg_data:
begin_fid = record['used_segment']['begin_fid']
end_fid = record['used_segment']['end_fid']
temporal_gt_begin_fid = record['temporal_gt']['begin_fid'] - 1
temporal_gt_end_fid = record['temporal_gt']['end_fid'] - 1
frame_count = record['frame_count']
if temporal_gt_begin_fid < begin_fid:
print(f"temporal_gt_begin_fid:{temporal_gt_begin_fid} is less than begin_fid{begin_fid}")
if temporal_gt_end_fid > end_fid:
print(f"gt_end_fid:{temporal_gt_end_fid} is greater than end_fid:{end_fid}")
if end_fid > frame_count:
print(f"end_fid:{end_fid} is not less than frame_count:{frame_count}")
|