abdullahsajid commited on
Commit
6634561
·
verified ·
1 Parent(s): 02f1fb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -20
app.py CHANGED
@@ -49,26 +49,26 @@ print('Models Loaded Successfully')
49
 
50
 
51
 
52
- @app.route('/', methods=['GET'])
53
- def get_data():
54
- img = plt.imread('test1.jpeg')
55
- img_arr = np.array(img)
56
- pil_img = Image.fromarray(img_arr.astype(np.uint8))
57
- buffered = io.BytesIO()
58
- pil_img.save(buffered, format="JPEG")
59
- img_str = base64.b64encode(buffered.getvalue()).decode()
60
-
61
- data = {
62
- 'message': 'Hello, World!',
63
- 'items': [1, 2, 3, 4, 5],
64
- 'image': img_str
65
- }
66
- return jsonify(data)
67
-
68
-
69
- @app.route('/test')
70
- def home():
71
- return "Welcome to the Flask API!"
72
 
73
  @app.route('/', methods=['POST'])
74
  def post_data():
 
49
 
50
 
51
 
52
+ # @app.route('/', methods=['GET'])
53
+ # def get_data():
54
+ # img = plt.imread('test1.jpeg')
55
+ # img_arr = np.array(img)
56
+ # pil_img = Image.fromarray(img_arr.astype(np.uint8))
57
+ # buffered = io.BytesIO()
58
+ # pil_img.save(buffered, format="JPEG")
59
+ # img_str = base64.b64encode(buffered.getvalue()).decode()
60
+
61
+ # data = {
62
+ # 'message': 'Hello, World!',
63
+ # 'items': [1, 2, 3, 4, 5],
64
+ # 'image': img_str
65
+ # }
66
+ # return jsonify(data)
67
+
68
+
69
+ # @app.route('/test')
70
+ # def home():
71
+ # return "Welcome to the Flask API!"
72
 
73
  @app.route('/', methods=['POST'])
74
  def post_data():