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}") | |