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
def getAnnotation(self, subset, anno):
temporal_dict={}
for idx in anno.keys():
labels = anno[idx]['annotations']
subset_vid = anno[idx]['subset']
num_frame = anno[idx]['feature_frame']
vid_frame = anno[idx]['duration_frame']
num_sec = anno[idx]['duration_second']
corr_sec = float(num_frame) / vid_frame * num_sec
label_list= []
if subset in subset_vid:
if 'unlabel' not in subset_vid:
for j in range(len(labels)):
tmp_info = labels[j]
clip_factor = self.temporal_scale / ( corr_sec * (self.num_frame+1) )
action_start = tmp_info['segment'][0]*clip_factor
snip_start = max(min(1, tmp_info['segment'][0] / corr_sec), 0)
action_end = tmp_info['segment'][1]*clip_factor
snip_end = max(min(1, tmp_info['segment'][1] / corr_sec), 0)
gt_label = tmp_info["label"]
if action_end - action_start > 1:
label_list.append([snip_start,snip_end,gt_label])
if len(label_list)>0:
temporal_dict[idx]= {"labels":label_list,
"video_duration": num_sec}
return temporal_dict
The getAnnotation() function has been used multiple times, I have questions about the following two lines of the function
if action_end - action_start > 1:
label_list.append([snip_start,snip_end,gt_label])
Should we add an indentation and enter for j in range (len (labels)): inside?
I found that this filtering operation is to delete temporal action annotations with a duration of less than 1 second. At the same time, if a video does not contain temporal action annotations with a duration of more than 1 second, the sample will be deleted. Is this implementation reasonable? Can the samples in the test set also be processed in this way?
The text was updated successfully, but these errors were encountered:
The getAnnotation() function has been used multiple times, I have questions about the following two lines of the function
Should we add an indentation and enter for j in range (len (labels)): inside?
I found that this filtering operation is to delete temporal action annotations with a duration of less than 1 second. At the same time, if a video does not contain temporal action annotations with a duration of more than 1 second, the sample will be deleted. Is this implementation reasonable? Can the samples in the test set also be processed in this way?
The text was updated successfully, but these errors were encountered: