diff --git a/__pycache__/app.cpython-310.pyc b/__pycache__/app.cpython-310.pyc new file mode 100644 index 0000000..0589864 Binary files /dev/null and b/__pycache__/app.cpython-310.pyc differ diff --git a/app.py b/app.py index 4302775..1226968 100644 --- a/app.py +++ b/app.py @@ -1,10 +1,16 @@ import os import os.path + +import flask import werkzeug import cv2 from flask import Flask, jsonify, send_file, request from flask_restful import Resource, Api, reqparse from werkzeug.sansio.multipart import MultipartEncoder +from flask import redirect, url_for, send_from_directory, render_template +import json + +from werkzeug.utils import secure_filename import yolov5.detect @@ -15,9 +21,14 @@ class Upload(Resource): def post(self): parser = reqparse.RequestParser() + print("parser") + print(parser) parser.add_argument('file', type=werkzeug.datastructures.FileStorage, location='files') args = parser.parse_args() + print("args") + print(args) + file_object = args['file'] print(file_object) if file_object is None: @@ -158,7 +169,6 @@ def post(self): else: count_muzzle_check1 = count_muzzle_check1 + 1 - print("======result_muzzle222======") print("count_muzzle_check1 ") print(count_muzzle_check1) @@ -246,5 +256,15 @@ def hello_world(): # put application's code here return 'Hello World!' +class HelloWorld(Resource): + def get(self): # GET 요청시 리턴 값에 해당 하는 dict를 JSON 형태로 반환 + return "test" + + +api.add_resource(HelloWorld, '/test') + +if __name__ == "__main__": + app.run(debug=True, host='0.0.0.0', port=80) + if __name__ == '__main__': - app.run() + app.run() \ No newline at end of file