Week 13 - Visual Predictor

3 minute read

First version for Visual Predictor

I have been improving the GUI Interface this weeks and integrating new options to the user. All the code can be found in Github

Using PySimpleGUI

NEW OPTIONS ADDED:

  • FPS are working propertly now.
  • Use prediction checkbox now added for Live Video.
  • The Logs now have the desire format, detailed time and data are added so we can check where the software fails and get more information about the predictions.
  • Add graphs checkbox to obtain Max error and another log txt file that explain with porcentajes the error on each prediction.

Diffrents FPS deppending the moment:

  • Preprocessor
Cap6
  • Extract centroid / buffer
Cap7
  • Getting predictions
Cap8
  • Main interfaz changed:
Cap0
Cap1
  • I reused some graphs from Nuria project that were very useful for me at the begining. Why can see when and how the prediction fails with detail and use it to obtain better neural models to train and test.
Cap2
Cap3
  • As you can see the main error appears at the beggining of the video, we the ball make some strange movements.
Cap4
  • The main error in this particular video was 7.5% (Recorded Video)
  • Bad results with Live Video, around 35 % error
Cap5

The logs files have been improved and now we get a WARNING advise when the predicted frame is offset more than 5 pixels. The WARING message appears when it happend in X axis or Y axis and now it’s easily to know when our software is not working as it should. The differents between predicted and real values can be change easily.

2021-12-19 20:56:33,529 INFO Frame extraction extarting… 2021-12-19 20:56:33,529 INFO Getting buffer values 2021-12-19 20:56:35,799 INFO Frame nº 0:[59 0] 2021-12-19 20:56:35,981 INFO Frame nº 1:[58 1] 2021-12-19 20:56:36,113 INFO Frame nº 2:[58 2] 2021-12-19 20:56:36,255 INFO Frame nº 3:[58 2] 2021-12-19 20:56:36,391 INFO Frame nº 4:[58 3] 2021-12-19 20:56:36,529 INFO Frame nº 5:[57 4] 2021-12-19 20:56:36,663 INFO Frame nº 6:[57 5] 2021-12-19 20:56:36,800 INFO Frame nº 7:[56 7] 2021-12-19 20:56:36,948 INFO Frame nº 8:[56 9] 2021-12-19 20:56:37,092 INFO Frame nº 9:[55 11] 2021-12-19 20:56:37,238 INFO Frame nº 10:[55 12] 2021-12-19 20:56:37,388 INFO Frame nº 11:[55 15] 2021-12-19 20:56:37,539 INFO Frame nº 12:[54 17] 2021-12-19 20:56:37,690 INFO Frame nº 13:[54 19] 2021-12-19 20:56:37,843 INFO Frame nº 14:[54 20] 2021-12-19 20:56:37,999 INFO Frame nº 15:[53 22] 2021-12-19 20:56:38,145 INFO Frame nº 16:[53 24] 2021-12-19 20:56:38,298 INFO Frame nº 17:[52 26] 2021-12-19 20:56:38,443 INFO Frame nº 18:[52 28] 2021-12-19 20:56:38,590 INFO Frame nº 19:[52 30]

2021-12-19 20:56:44,503 DEBUG Frame nº 50; Real value to predict… [41 83] 2021-12-19 20:56:44,503 DEBUG Frame nº 50; Predicted value… [86 67] 2021-12-19 20:56:44,503 WARNING —– BAD PREDICTION. More than 5 pixels of differential in X axis —– Real value… 41 vs Predicted value… 86 2021-12-19 20:56:44,504 WARNING —– BAD PREDICTION. More than 5 pixels of differential in Y axis —– Real value… 83 vs Predicted value… 67

2021-12-19 20:56:48,932 DEBUG —– GOOD PREDICTION —– 2021-12-19 20:56:49,247 DEBUG Frame nº 66; Real value to predict… [ 36 109] 2021-12-19 20:56:49,247 DEBUG Frame nº 66; Predicted value… [ 38 108] 2021-12-19 20:56:49,248 DEBUG —– GOOD PREDICTION —– 2021-12-19 20:56:49,639 DEBUG Frame nº 67; Real value to predict… [ 36 111] 2021-12-19 20:56:49,639 DEBUG Frame nº 67; Predicted value… [ 37 108] 2021-12-19 20:56:49,639 DEBUG —– GOOD PREDICTION —– 2021-12-19 20:56:50,012 DEBUG Frame nº 68; Real value to predict… [ 35 112] 2021-12-19 20:56:50,012 DEBUG Frame nº 68; Predicted value… [ 36 110] 2021-12-19 20:56:50,012 DEBUG —– GOOD PREDICTION —– 2021-12-19 20:56:52,398 INFO Video Prediction ended…

We can see how the firsts prediction are not good, but at the end of the video is aproaching to the expected result

Processed sample 0: Target position: [41 83] Position: [86 67] Error: 47.76 (33.12%) ————————————————————– Processed sample 1: Target position: [41 85] Position: [85 72] Error: 45.88 (31.81%) ————————————————————– Processed sample 2: Target position: [41 87] Position: [78 88] Error: 37.01 (25.66%) ————————————————————– Processed sample 3: Target position: [40 88] Position: [77 96] Error: 37.85 (26.25%)

Processed sample 16: Target position: [ 36 109] Position: [ 38 108] Error: 2.24 (1.55%) ————————————————————– Processed sample 17: Target position: [ 36 111] Position: [ 37 108] Error: 3.16 (2.19%) ————————————————————– Processed sample 18: Target position: [ 35 112] Position: [ 36 110] Error: 2.24 (1.55%) ————————————————————–

Next steps will be continue with GUI and come back to generate new datasets to get better models and better predictions finally. Also the code from Visual Predictor and the subprograms needs to be depurate.