config.py 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # main imports
  2. import os
  3. # env variables
  4. WEB_API_PREFIX_URL_KEY = 'WEB_API_PREFIX_URL'
  5. WEB_API_PREFIX_URL = os.environ.get(WEB_API_PREFIX_URL_KEY) \
  6. if os.environ.get(WEB_API_PREFIX_URL_KEY) is not None else 'api'
  7. # api variables
  8. DIRAN_DOMAIN_NAME = "https://diran.univ-littoral.fr/"
  9. GET_SCENE_QUALITIES_API_URL = DIRAN_DOMAIN_NAME + WEB_API_PREFIX_URL + "/listSceneQualities?sceneName={0}"
  10. GET_SCENE_IMAGE_API_URL = DIRAN_DOMAIN_NAME + WEB_API_PREFIX_URL + "/getImage?sceneName={0}&imageQuality={1}"
  11. GET_SCENES_API_URL = DIRAN_DOMAIN_NAME + WEB_API_PREFIX_URL + "/listScenes"
  12. # folder variables
  13. # TODO : dispatch into day and experiment ID
  14. model_expe_folder = "expes_models/{0}/{1}"
  15. output_expe_folder = "expes_results"
  16. output_expe_folder_date = "expes_results/date"
  17. output_expe_folder_id = "expes_results/expeId"
  18. output_expe_folder_name_id_day = "expes_results/expeId/{0}/{1}/{2}/{3}"
  19. output_expe_folder_name_day = "expes_results/date/{0}/{1}/{2}"
  20. output_tmp_folder = "tmp"
  21. # expes list
  22. expe_name_list = ["quest_one_image"]
  23. # configure experiments labels
  24. expes_configuration = {
  25. # First experiments configuration
  26. 'quest_one_image':{
  27. 'text':{
  28. 'question': "Do you see one image or a composition of more than one?",
  29. 'indication': "press left if you see one image, right if not",
  30. 'end_text': "Experience is finished. Thanks for your participation",
  31. 'examples': {
  32. 'sentence': "This images is cropped {0} with {1}%",
  33. 'crop_params': [
  34. [0.3, 0, 0],
  35. [0.3, 0, 0],
  36. [0.7, 1, 0]
  37. ],
  38. 'images': [
  39. [2, -1],
  40. [-3, -1],
  41. [7, -1]
  42. ]
  43. }
  44. },
  45. 'params':{
  46. 'iterations': 10
  47. },
  48. 'slopes':{
  49. },
  50. # if others custom session param are directly set for experiments
  51. 'session_params': [
  52. 'expe_data',
  53. ],
  54. # template file used in django `expe` route
  55. 'template': 'expe/expe.html',
  56. # javascript file used
  57. 'javascript':[
  58. 'loadImg.js',
  59. 'keyEvents.js'
  60. ],
  61. 'output_header':
  62. "stimulus;name_stimulus;cropping_percentage;orientation;image_ref_position;answer;time_reaction;entropy\n"
  63. }
  64. }