harvitronix / five-video-classification-methods

Code that accompanies my blog post outlining five video classification methods in Keras and TensorFlow
https://medium.com/@harvitronix/five-video-classification-methods-implemented-in-keras-and-tensorflow-99cad29cc0b5
MIT License
1.17k stars 479 forks source link

modified source path of moving, so that it can find UCF-101 dataset #115

Open ideaRunner opened 5 years ago

ideaRunner commented 5 years ago

Hi Matt Harvey,

In 1_move_files.py , the filename is only the video file name. it doesn't contain the path of UCF dataset and classname path. That is the reason that when run it, it returns "Can't find xxx to move. Skipping xxx."

I modified

            if not os.path.exists(filename):
                print("Can't find %s to move. Skipping." % (filename))
                continue

            # Move it.
            dest = os.path.join(group, classname, filename)
            print("Moving %s to %s" % (filename, dest))
            os.rename(filename, dest)

to

            src = os.path.join("UCF-101", classname, filename)
            if not os.path.exists(src):
                print("Can't find %s to move. Skipping." % (src))
                continue

            # Move it.
            dest = os.path.join(group, classname, filename)
            print("Moving %s to %s" % (src, dest))
            os.rename(src, dest)

This way others don’t need to modify it again.

orapradeep commented 5 years ago

also change line "parts = video.split(os.path.sep)" to "parts = video.split('/')"