
--- action.py
+++ action.py
... | ... | @@ -5,7 +5,6 @@ |
5 | 5 |
from database.database import DB |
6 | 6 |
import torch |
7 | 7 |
from torchvision.transforms import ToTensor |
8 |
-from datetime import datetime |
|
9 | 8 |
from model.AttentiveRNN import AttentiveRNN |
10 | 9 |
from model.Classifier import Resnet as Classifier |
11 | 10 |
from subfuction.image_crop import crop_image |
... | ... | @@ -36,20 +35,6 @@ |
36 | 35 |
description="노드 분석을 위해 사용하는 api.", |
37 | 36 |
) |
38 | 37 |
|
39 |
- |
|
40 |
-# @Action.route('/image_summit') |
|
41 |
-# class fileUpload(Resource): |
|
42 |
-# @Action.doc(responses={200: 'Success'}) |
|
43 |
-# @Action.doc(responses={500: 'Register Failed'}) |
|
44 |
-# def post(self): |
|
45 |
-# if request.method == 'POST': |
|
46 |
-# f = request.files['file'] |
|
47 |
-# f.save(secure_filename(f.filename)) |
|
48 |
-# return { |
|
49 |
-# 'save': 'done' # str으로 반환하여 return |
|
50 |
-# }, 200 |
|
51 |
- |
|
52 |
- |
|
53 | 38 |
@Action.route('/image_anal') |
54 | 39 |
class fileUpload(Resource): |
55 | 40 |
@Action.doc(responses={200: 'Success'}) |
... | ... | @@ -68,8 +53,8 @@ |
68 | 53 |
|
69 | 54 |
lat = float(data['gps_x']) |
70 | 55 |
lon = float(data['gps_y']) |
71 |
- filename = data['filename'] |
|
72 |
- file_type = data['file_type'] |
|
56 |
+ # filename = data['filename'] |
|
57 |
+ # file_type = data['file_type'] |
|
73 | 58 |
|
74 | 59 |
uploaded_file = request.files.get('file') |
75 | 60 |
file_bytes = np.asarray(bytearray(uploaded_file.read()), dtype=np.uint8) |
--- app.py
+++ app.py
... | ... | @@ -2,15 +2,15 @@ |
2 | 2 |
from flask_restx import Api |
3 | 3 |
from auth import Auth |
4 | 4 |
from action import Action |
5 |
+from flask_cors import CORS |
|
5 | 6 |
|
6 | 7 |
app = flask.Flask(__name__) |
8 |
+CORS(app) |
|
7 | 9 |
|
8 | 10 |
api = Api( app, |
9 | 11 |
version='0.1', |
10 | 12 |
title="RDS", |
11 | 13 |
description="API Server", |
12 |
- terms_url="/", |
|
13 |
- contact="[email protected]", |
|
14 | 14 |
license="MIT") |
15 | 15 |
|
16 | 16 |
api.add_namespace(Auth, '/auth') |
... | ... | @@ -18,5 +18,5 @@ |
18 | 18 |
api.add_namespace(Action, '/action') |
19 | 19 |
|
20 | 20 |
if __name__ == "__main__": |
21 |
- app.run(debug=True, host='0.0.0.0', port=8080) |
|
21 |
+ app.run(debug=False, host='0.0.0.0', port=8000) |
|
22 | 22 |
print("Flask Start")(No newline at end of file) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?