@@ -73,6 +73,7 @@ def save_settings(settings):
73
73
74
74
75
75
@app .route ("/save" , methods = ["POST" ])
76
+ @cross_origin (origin = client_url , headers = ["Content-Type" ])
76
77
def save_annotate_info ():
77
78
try :
78
79
request_data = request .get_json ()
@@ -131,11 +132,13 @@ def save_settings(settings):
131
132
132
133
133
134
@app .route ("/settings" , methods = ["GET" ])
135
+ @cross_origin (origin = client_url , headers = ["Content-Type" ])
134
136
def get_settings ():
135
137
return jsonify (initial_settings )
136
138
137
139
138
140
@app .route ("/settings" , methods = ["POST" ])
141
+ @cross_origin (origin = client_url , headers = ["Content-Type" ])
139
142
def update_settings ():
140
143
new_settings = request .json
141
144
initial_settings .update (new_settings )
@@ -144,6 +147,7 @@ def update_settings():
144
147
145
148
146
149
@app .route ("/settings/reset" , methods = ["POST" ])
150
+ @cross_origin (origin = client_url , headers = ["Content-Type" ])
147
151
def reset_settings ():
148
152
global initial_settings
149
153
initial_settings = default_settings .copy ()
@@ -152,6 +156,7 @@ def reset_settings():
152
156
153
157
154
158
@app .route ("/upload" , methods = ["POST" ])
159
+ @cross_origin (origin = client_url , headers = ["Content-Type" ])
155
160
def upload_file ():
156
161
try :
157
162
uploaded_files = []
@@ -222,6 +227,7 @@ def delete_file(filename):
222
227
223
228
224
229
@app .route ("/activeImage" , methods = ["POST" ])
230
+ @cross_origin (origin = client_url , headers = ["Content-Type" ])
225
231
def save_active_image_info ():
226
232
try :
227
233
request_data = request .get_json ()
@@ -338,6 +344,7 @@ def add_regions(regions, region_type=None):
338
344
339
345
340
346
@app .route ("/imagesName" , methods = ["POST" ])
347
+ @cross_origin (origin = client_url , headers = ["Content-Type" ])
341
348
def images_name ():
342
349
try :
343
350
data = request .get_json ()
@@ -371,6 +378,7 @@ def clear_upload_folder():
371
378
372
379
373
380
@app .route ("/clearSession" , methods = ["POST" ])
381
+ @cross_origin (origin = client_url , headers = ["Content-Type" ])
374
382
def clear_session ():
375
383
global initial_settings
376
384
try :
@@ -385,6 +393,7 @@ def clear_session():
385
393
386
394
387
395
@app .route ("/download_configuration" , methods = ["POST" ])
396
+ @cross_origin (origin = client_url , headers = ["Content-Type" ])
388
397
def download_configuration ():
389
398
try :
390
399
data = request .get_json ()
@@ -418,6 +427,7 @@ def download_configuration():
418
427
419
428
420
429
@app .route ("/class_distribution" , methods = ["POST" ])
430
+ @cross_origin (origin = client_url , headers = ["Content-Type" ])
421
431
def class_distribution ():
422
432
try :
423
433
class_data = dbModule .get_class_distribution ()
@@ -435,6 +445,7 @@ def class_distribution():
435
445
436
446
437
447
@app .route ("/download_image_with_annotations" , methods = ["POST" ])
448
+ @cross_origin (origin = client_url , headers = ["Content-Type" ])
438
449
def download_image_with_annotations ():
439
450
temp_dir = None # Initialize temporary directory variable
440
451
@@ -740,6 +751,7 @@ def get_image_annotations():
740
751
741
752
742
753
@app .route ("/download_image_mask" , methods = ["POST" ])
754
+ @cross_origin (origin = client_url , headers = ["Content-Type" ])
743
755
def download_image_mask ():
744
756
try :
745
757
data = request .get_json ()
@@ -1068,6 +1080,7 @@ def create_yolo_annotations(image_names, color_map=None):
1068
1080
1069
1081
1070
1082
@app .route ("/download_yolo_annotations" , methods = ["POST" ])
1083
+ @cross_origin (origin = client_url , headers = ["Content-Type" ])
1071
1084
def download_yolo_annotations ():
1072
1085
data = request .get_json ()
1073
1086
image_names = data .get ("image_names" , [])
@@ -1120,6 +1133,7 @@ def download_yolo_annotations():
1120
1133
1121
1134
1122
1135
@app .route ("/imagesInfo" , methods = ["GET" ])
1136
+ @cross_origin (origin = client_url , headers = ["Content-Type" ])
1123
1137
def get_images_info ():
1124
1138
global path
1125
1139
0 commit comments