Skip to content

Train the C3D network with my own data set. Video or gif can be supported as a training file. Video streams or image frames can be used as input for detection.

License

Notifications You must be signed in to change notification settings

lianggyu/C3D-Action-Recognition

Repository files navigation

C3D-Action-Recognition

Train the C3D network with my own data set. Video or gif can be supported as a training file. Video streams or image frames can be used as input for detection.

Environment

  • opencv-3.2
  • keras-2.0.8
  • tensorflow-1.3

Train your own data

  • Place the data in the datasets/ucf101. The label for training (train_file.txt), label for testing (test_file.txt), are placed in the /ucfTrainTestlist. Record category in classInd.txt.

  • Run video2img.py and save it in the datasets/ucfimgs. Currently gif and video formats are supported.

  • Run make_label_txt.py and generate train_list.txt and test_list.txt.

  • Modify model.py, such as lines 7~9.

  • Modify train_c3d.py, such as lines 158~164. Run train_c3d.py.

Demo

  • Modify config.txt
    classInd_path : the file path of the record category
    lr : learning rate (default 0.005)
    momentum : Momentum (default 0.9)
    weights_path : path to the trained model

    Image mode:
    image_read : the path to the image read
    image_write : the path written by the image

    video_image: select input mode
    video: the mode of video input
    image: the mode of image input

  • Modify video_demo.py
    If you want to apply it to the video stream, you must first modify the dictionary(video_stream).
    video_stream[key].[0] : This is an array that records 16 video frames as input to the model.
    video_stream[key].[1] : the path to the data.
    video_stream[key].[2] : the path of the model.

  • Run video_demo.py
    Identification of abnormal-event and normal-event:
    normal-event abnormal-event
    Identification of smoking:
    normal-event abnormal-event

About

Train the C3D network with my own data set. Video or gif can be supported as a training file. Video streams or image frames can be used as input for detection.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages