3loi / MSP_Face

MIT License
11 stars 4 forks source link

There is a bug when segments the video #9

Closed youcaiSUN closed 2 years ago

youcaiSUN commented 2 years ago
    counter_enter_out = 0; #We know that the segments are in order, so we need to check they match and no match of the file names then our algorithm is more efficient
    for k in range(len(file_segments_data['f2'])):

        if orginal_video_name[:-4] in file_segments_data['f2'][k].decode('utf-8'):

            if counter_enter_out == 0:
                counter_enter_out = 1;
                        ...

            if counter_enter_out == 1:
                break;

In the _videosegmentation function, you try to use a flag variable counter_enter_out to indicate whether segmentation for current video are over or not. However, above implementation is wrong and only the first video clip will be segmented from the video.

The correct way can be like this (i.e., you missed a else branch to break the for loop for the first if condition):

    counter_enter_out = 0; #We know that the segments are in order, so we need to check they match and no match of the file names then our algorithm is more efficient
    for k in range(len(file_segments_data['f2'])):

        if orginal_video_name[:-4] in file_segments_data['f2'][k].decode('utf-8'):

            if counter_enter_out == 0:
                counter_enter_out = 1;
                        ...

                else:
            if counter_enter_out == 1:
                break;
AndreaVidal commented 2 years ago

Hi youcaiSUN! Sorry for the late response. Thanks for pointing the bug in the code.