rotemtzaban / STIT

MIT License
1.2k stars 170 forks source link

The composite video is a little shaky #33

Closed c1a1o1 closed 1 year ago

c1a1o1 commented 2 years ago

The composite video is a little shaky

rotemtzaban commented 2 years ago

@c1a1o1 Hi, I'm not exactly sure, but it seems to me like the order of frames might be somewhat messed up. How did you split the video into frames? The frames are sorted in alphabetical order, so "frame10.png" comes before "frame1.png". The solution to that would be to add leading zeros, which the command in our README does automatically: ffmpeg -i "video.mp4" "video_frames/out%04d.png"

Hope this helps

johndpope commented 2 years ago

it maybe the 18 frames instead of 25? check the latest code.

850552586 commented 2 years ago

it maybe the 18 frames instead of 25? check the latest code.

Not this reason,it should change the sorted method.

def make_dataset(dir):
    images = []
    assert os.path.isdir(dir), '%s is not a valid directory' % dir
    for fname in sorted(os.listdir(dir)):
        if is_image_file(fname):
            path = os.path.join(dir, fname)
            fname = fname.split('.')[0]
            images.append((fname, path))
    return images

This sort function which the repo used is based on string priority, so 2.png will be later than 10.png.

c1a1o1 commented 2 years ago

Thanks for all! @rotemtzaban @rinongal @850552586