tyiannak / multimodal_movie_analysis

A Python Library for Multimodal Analysis of Movies and Content-based Movie Recommendation
25 stars 8 forks source link

Add a tool under visual subfolder for command-line shot detection #9

Closed tyiannak closed 3 years ago

tyiannak commented 3 years ago

Description

tyiannak commented 3 years ago

Also do some qualitative evalauation (does shot change work on movies)?

apoman38 commented 3 years ago

A new file named shot_generator.py was created based on analy_visual.py

Using the existing function shot_change it was easy to find the shots. Initially, a new movie_time variable was added where the timestamp is stored when the shot changes. The milliseconds were then converted in the form of for this purpose a new function called milisec_to_time was created. At the end, the code additionally prints the number of shots contained in the video, the time at which the shot starts and the moment it ends (in NumPy array format). The end result is the creation of many different videos where their number is equal to the number of shots contained in the video requested by the user.

Please check the code and let me know for bugs or any problems.

P.S Need to install a new library named moviepy

apoman38 commented 3 years ago

I forgot to mention that I added 2 new videos to the dataset folder in case you want to test the code.

tyiannak commented 3 years ago

The code should be much shorter. There's no need to use all code from analyze_visual.py, just do the following:

apoman38 commented 3 years ago

Code refactoring was performed on the shot_generator.py file

P.S The code is executed in the same way as in the analyze_visual.py file

apoman38 commented 3 years ago

shot_generator.py works properly.