jfzhang95 / pytorch-video-recognition

PyTorch implemented C3D, R3D, R2Plus1D models for video activity recognition.
MIT License
1.16k stars 250 forks source link

Method to pre-process video to images #60

Closed hongbo-miao closed 3 years ago

hongbo-miao commented 3 years ago

I met this issue, after searching but I didn't find solutions in these tickets: https://github.com/jfzhang95/pytorch-video-recognition/issues/36 https://github.com/jfzhang95/pytorch-video-recognition/issues/52

To save some time for future people, here is the method:

  1. Take UCF101 for example, download the dataset at https://www.crcv.ucf.edu/data/UCF101/UCF101.rar

  2. Update https://github.com/jfzhang95/pytorch-video-recognition/blob/master/mypath.py to point to correct dataset and model paths like

class Path(object):
    @staticmethod
    def db_dir(database):
        if database == 'ucf101':
            # folder that contains class labels
            root_dir = '/Users/hongbo-miao/pytorch-video-recognition/datasets/UCF-101'

            # Save preprocess data into output_dir
            output_dir = '/Users/hongbo-miao/pytorch-video-recognition/datasets/ucf101'

            return root_dir, output_dir
        elif database == 'hmdb51':
            # folder that contains class labels
            root_dir = '/Users/hongbo-miao/pytorch-video-recognition/datasets/hmdb-51'

            output_dir = '/Users/hongbo-miao/pytorch-video-recognition/datasets/hmdb51'

            return root_dir, output_dir
        else:
            print('Database {} not available.'.format(database))
            raise NotImplementedError

    @staticmethod
    def model_dir():
        return '/Users/hongbo-miao/pytorch-video-recognition/models/c3d-pretrained.pth'

Search all places and replace from pretrained=True to pretrained=False.

  1. Run python train.py, then you will see it starts to pre process image

Once pre-processing done, it will start to train.

xiehewei commented 2 years ago

Can you show me your directory tree and dataset structure?I always encounter such mistakes。 image

xiehewei commented 2 years ago

Why? image

hongbo-miao commented 2 years ago

Hi @xiehewei151782 it has been a long time I was working on it. I cannot really remember. The doc I wrote here worked for me at that moment to set up this repo.

Our team repo is at https://github.com/stanford-action-recognition/ar . Hope the info there can help you go further! 😃

282517bjiMNqwewed commented 1 year ago

你能给我看看你的目录树和数据集结构吗?我总是遇到这样的错误。 图像 哈喽,我也遇到类似问题,请问你最后怎么解决的呢

Wangdanchunbufuz commented 5 months ago

Why? image

你好,我也遇到了这样的问题,请问您是怎样解决的呢? image

Wangdanchunbufuz commented 5 months ago

Why? image

你好,我也遇到了这样的问题,请问您是怎样解决的呢? image

282517bjiMNqwewed commented 5 months ago

好像是把某个代码中的false改成true。您可以网上搜一下这个代码复现,还挺多的

---Original--- From: @.> Date: Mon, Jan 15, 2024 21:58 PM To: @.>; Cc: @.**@.>; Subject: Re: [jfzhang95/pytorch-video-recognition] Method to pre-process videoto images (#60)

Why?

你好,我也遇到了这样的问题,请问您是怎样解决的呢? image.png (view on web)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

Wangdanchunbufuz commented 5 months ago

好像是把某个代码中的false改成true。您可以网上搜一下这个代码复现,还挺多的 ---Original--- From: @.> Date: Mon, Jan 15, 2024 21:58 PM To: @.>; Cc: @.**@.>; Subject: Re: [jfzhang95/pytorch-video-recognition] Method to pre-process videoto images (#60) Why? 你好,我也遇到了这样的问题,请问您是怎样解决的呢? image.png (view on web) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

谢谢,根据你的提示我解决了这个问题!十分感谢

Wangdanchunbufuz commented 5 months ago

请问是否有遇到过卡在这里不训练的情况吗? image