SforAiDl / Playground

A python library consisting of pipelines for visual analysis of different sports using Computer Vision and Deep Learning.
MIT License
18 stars 17 forks source link

Add option for detecting on videos #4

Closed ashwinvaswani closed 4 years ago

ashwinvaswani commented 4 years ago

In the detector, check if the input is image or video. If it is a video then parse through the video and run the detector on each of the individual frames of the video.

Sharanranjit commented 4 years ago

Hey! I'm willing to take up this issue. I just wanted to point out some things after I went through the code briefly :

  1. Based on #4 and #5, it looks like the we need a function for loading dataset(images/videos), which is currently done by just inputting the image path directly.
  2. Using opencv would make it easier for preprocessing and reading videos/images. I understand we have used pillow for preprocessing using torchvision.transforms. Opencv is just a suggestion from my side.

You can suggest your changes in the appropriate file, I will try implementing them.

ashwinvaswani commented 4 years ago

Sure. In that case, let's keep it standard process to use OpenCV from now on. In the file Badminton/Badminton.py do the following: Currently, only path is taken as input, Add an additional parameter taking input as loaded image array so that the user has option of using ANY ONE form of input. Put appropriate checks in place such that if two parameters are passed, an error is shown as loaded image, and image from the input image path might be different in an exceptional case leading to bugs.

Create another method with the name detect_players_video() which takes in the video / video path as parameter similar to above, parser through the video, and runs detections on it.

Best of luck!