tyiannak / multimodal_movie_analysis

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

Add posterior calculation to wrapper #45 #46

Closed apoman38 closed 3 years ago

apoman38 commented 3 years ago

What this PR does:

1) Add docstrings to functions of shot_generation.py file, usage example, etc. 2) Process video returns more values when shot_generation was created. So added some underscores when the process_video() called. 3) In wrapper.py added posterior probability calculation of every class.

How to QA: 1) Train a model with train.py 2) Run wrapper.py on a single file. Should be printed the posterior probability of every class of the given file. 3) Run wrapper.py in a directory. Should be printed at the end of the process the mean of posteriors. Also, check if a file is created with the name of the directory that you gave. This file contains the posterior probability of every video extensively.

tyiannak commented 3 years ago

Getting the following error Havent' u changed the training so that the classifiers extract probabilistic outputs?

Traceback (most recent call last):
  File "wrapper.py", line 110, in <module>
    main(sys.argv)
  File "wrapper.py", line 80, in main
    probas, classes = video_class_predict(features, algorithm)
  File "wrapper.py", line 58, in video_class_predict
    results = model.predict_proba(features_scaled)
  File "/Users/tyiannak/.pyenv/versions/3.7.3/lib/python3.7/site-packages/sklearn/utils/metaestimators.py", line 114, in __get__
    getattr(delegate, self.attribute_name)
  File "/Users/tyiannak/.pyenv/versions/3.7.3/lib/python3.7/site-packages/sklearn/svm/_base.py", line 666, in predict_proba
    self._check_proba()
  File "/Users/tyiannak/.pyenv/versions/3.7.3/lib/python3.7/site-packages/sklearn/svm/_base.py", line 633, in _check_proba
    raise AttributeError("predict_proba is not available when "
AttributeError: predict_proba is not available when  probability=False
apoman38 commented 3 years ago

With which classifier, you trained the model?

tyiannak commented 3 years ago

With which classifier, you trained the model?

SVM

apoman38 commented 3 years ago

Please pull and check again. Let me know if there are more issues.

apoman38 commented 3 years ago

Wrapper.py update: All the outputs are saved in a CSV format file.

How to QA: Run python3 wrapper.py -i folder -m Algorithm -o output_file.csv. Check if the output file is created and works properly.