Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative Location of input for TVQA #12

Open
vateye opened this issue Apr 22, 2022 · 1 comment
Open

Relative Location of input for TVQA #12

vateye opened this issue Apr 22, 2022 · 1 comment

Comments

@vateye
Copy link

vateye commented Apr 22, 2022

Hi, I have a question about the relative location for TVQA.
`t_start = midpoint - segment_size * 0.5
t_end = midpoint + segment_size * 0.5

# Try to extend by 3 segments in either direction of the middle
times_used0 = [{'start_time': t_start, 'end_time': t_end}]
for i in range(6):
    for delta in [-segment_size, segment_size]:
        t0 = t_start + delta * (i+1)
        t1 = t_end + delta * (i+1)

        t0 = round(t0 * 3) / 3
        t1 = round(t1 * 3) / 3

        if t1 < 0:
            continue
        if t0 > max_time:
            continue
        if len(times_used0) < 7:
            times_used0.append({'start_time': t0, 'end_time': t1})
times_used0 = sorted(times_used0, key=lambda x: x['start_time'])

# Figure out the relative position of the annotation
my_duration = times_used0[-1]['end_time'] - times_used[0]['start_time']
rel_localized_tstart = (ts0 - times_used[0]['start_time']) / my_duration
rel_localized_tend = (ts1 - times_used[0]['start_time']) / my_duration
qa_item['rel_localization'] = (rel_localized_tstart, rel_localized_tend)`

For the above code, I suspect that the rel_localized_tstart could be greater than rel_localized_tend since the "midpoint - segment_size * 0.5" could less than zero?

Besides, does the rel_localized_tstart or rel_localized_tend can be a negative number?

@rowanz
Copy link
Owner

rowanz commented Apr 22, 2022

oh interesting! we didn't run into that though -- I think that means that all TVQA clips are longer than segment_size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants