display_scenes.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/usr/bin/env python3
  2. __author__ = "Olivier Vu thanh"
  3. __email__ = "olivier.vu-thanh@grenoble-inp.org"
  4. '''
  5. Run "python main.py --config_file=config.json"
  6. Available calibration methods are : emwnenmf (EM-W-NeNMF from [quote paper])
  7. : coming soon...
  8. '''
  9. import numpy as np
  10. import argparse
  11. import json
  12. import matplotlib.pyplot as plt
  13. from dataCreator import dataCreator
  14. from calibrationStatistics import calibrationStatistics
  15. from calibrationMethods.emwnenmf import emwnenmf
  16. print('Work in progress')
  17. '''
  18. Get the config (json) file, see "config.json" for default one
  19. '''
  20. parser = argparse.ArgumentParser(description='Parse location of config file (json).')
  21. parser.add_argument('--config_file', type=str, default='config.json',
  22. help='path to json config file, see config.json for default')
  23. args = parser.parse_args()
  24. with open(args.config_file) as json_data_file:
  25. config = json.load(json_data_file)
  26. '''
  27. Main loop
  28. '''
  29. data = dataCreator(config['sceneWidth'],
  30. config['sceneLength'],
  31. config['sensorR'],
  32. config['refR'],
  33. config['rdvR'],
  34. config['mvR'],
  35. config['phenLowerBound'],
  36. config['phenUpperBound'],
  37. config['Mu_beta'],
  38. config['Mu_alpha'],
  39. config['Bound_beta'],
  40. config['Bound_alpha'])
  41. m = data.numArea
  42. n = data.numSensor+1
  43. Res = {}
  44. for run in range(config['numRuns']):
  45. data.create_scene(run)
  46. data.show_scene()
  47. # print(data.W)