dolongbien / HumanBehaviorBKU

Abnormal Human Behaviors Detection/ Road Accident Detection From Surveillance Videos/ Real-World Anomaly Detection in Surveillance Videos/ C3D Feature Extraction
158 stars 57 forks source link

[web app] can't view any of the videos #2

Closed PrincyX closed 5 years ago

PrincyX commented 5 years ago

The integration went mostly successful and after a few hours of debugging, I was successfully deployed the web app at localhost http://127.0.0.1:8000.

But when I click the "video demo" tab and click one of the videos, I get the following error

issue

any ideas on how to fix this?

thanks

edit: here's the server-side error

Internal Server Error: /catalog/video/abnormal/RoadAccidents343_x264
Traceback (most recent call last):
  File "C:\Users\Anaconda3\envs\[]\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
    response = get_response(request)
  File "C:\Users\c\Anaconda3\envs\trillion_question_mark\lib\site-packages\django\core\handlers\base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "C:\Users\p\Anaconda3\envs\trillion_question_mark\lib\site-packages\django\core\handlers\base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:\Users\c\Anaconda3\envs\trillion_question_mark\lib\site-packages\django\views\generic\base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "C:\Users\c\Anaconda3\envs\trillion_question_mark\lib\site-packages\django\views\generic\base.py", line 97, in dispatch
    return handler(request, *args, **kwargs)
  File "C:\Users\c\Anaconda3\envs\trillion_question_mark\lib\site-packages\django\views\generic\base.py", line 158, in get
    context = self.get_context_data(**kwargs)
  File "C:\\[]\HumanBehaviorBKU\WebApp\catalog\views.py", line 84, in get_context_data
    x, scores = get_score(video_path)
  File "C:\[]\HumanBehaviorBKU\WebApp\c3d\plot_controller.py", line 73, in get_score
    F_Score = np.matlib.repmat(predictions[iv],1,(int(total_segments[iv+1])-int(total_segments[iv])))
  File "C:\Users\[]\Anaconda3\envs\trillion_question_mark\lib\site-packages\numpy\matlib.py", line 362, in repmat
    c = a.reshape(1, a.size).repeat(m, 0).reshape(rows, origcols).repeat(n, 0)
ValueError: negative dimensions are not allowed
[17/Jul/2019 21:47:45] "GET /catalog/video/abnormal/RoadAccidents343_x264 HTTP/1.1" 500 115664
dolongbien commented 5 years ago

Hi,

This error occurs due to the lack of (mp4) videos. To visualize the score, it requires corresponding raw video. I have updated sample videos under /media/videos directory in the latest commit. You can check it out.

Best,

PrincyX commented 5 years ago

it works! Thanks. But I still don't understand how the web app works. It looks like all it does is graph the loss of each frame of the video in conjunction with the video player to the left. The video, itself, is not being tested with the machine learning model. Am I missing out on something here?

dolongbien commented 5 years ago

The feature extraction process had done for all the videos in test set before it was there. The web app does nothing but grabs that feature, feeds it into the model to get the abnormal score for each video segment and then distributes that score to each of the video frames. The video, itself, is just there for the system to be able to retrieve video information such as total of frames, the length, etc.

Apart from test video, you can upload a new video to the system, it will do all the things for you (feature extraction, inference and finally graph out the result).

Please let me know if you have any further questions.

cervantes-loves-ai commented 1 year ago

still getting same error, any suggestions?

3_sample