Skip to content

Commit

Permalink
update app.py
Browse files Browse the repository at this point in the history
테스트 추가
  • Loading branch information
sectionr0 committed Jun 3, 2022
1 parent 92d904b commit 3559078
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
Binary file added __pycache__/app.cpython-310.pyc
Binary file not shown.
24 changes: 22 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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:
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()

0 comments on commit 3559078

Please sign in to comment.