config.py 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. 'scenes':['contemporary', 'bathroom'],
  28. 'text':{
  29. 'question': "Do you see one image or a composition of more than one?",
  30. 'indication': "press RIGHT if you see 2 images, LEFT if not",
  31. 'end_text': "Experience is finished. Thanks for your participation",
  32. 'examples': {
  33. 'sentence': ["First example of 2 images:\n This image is cropped {0}.\n {1}% on the left originating from a low-quality image and on the right originating from high quality. \n So, press RIGHT.",
  34. "Second example of 1 image: \n This image is cropped {0}. \n {1}% on the left originating from a high-quality image and on the right originating from high quality, too.\n So, press LEFT",
  35. "Third example of 2 images: \n This image is cropped {0}. \n {1}% on the upper part originating from a low-quality image and on the bottom originating from high quality. \n So, press RIGHT."],
  36. 'crop_params': [
  37. [0.3, 0, 0],
  38. [0.3, 0, 0],
  39. [0.7, 1, 0]
  40. ],
  41. 'images': [
  42. [2, -1],
  43. [-3, -1],
  44. [7, -1]
  45. ]
  46. }
  47. },
  48. 'params':{
  49. 'iterations': 100,
  50. 'entropy': 5,
  51. 'slopes':{
  52. 'contemporary' : [0.0001, 0.001, 0.00003], #start, stop, step
  53. 'bathroom' : [0.0005, 0.01, 0.0003], #start, stop, step
  54. },
  55. },
  56. # if others custom session param are directly set for experiments
  57. 'session_params': [
  58. 'expe_data',
  59. ],
  60. # template file used in django `expe` route
  61. 'template': 'expe/expe.html',
  62. # javascript file used
  63. 'javascript':[
  64. 'loadImg.js',
  65. 'keyEvents.js'
  66. ],
  67. 'output_header':
  68. "stimulus;name_stimulus;cropping_percentage;orientation;image_ref_position;answer;time_reaction;entropy\n"
  69. }
  70. }