Ramils commited on
Commit
a39ebea
·
1 Parent(s): 1387561

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py CHANGED
@@ -9,6 +9,8 @@ import json
9
  import gradio as gr
10
  from huggingface_hub import hf_hub_download
11
  import onnxruntime as rt
 
 
12
 
13
  modele = hf_hub_download(repo_id="onnx/EfficientNet-Lite4", filename="efficientnet-lite4-11.onnx")
14
  # load the labels text file
@@ -57,6 +59,19 @@ def inference(img):
57
  img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
58
 
59
  img = pre_process_edgetpu(img, (224, 224, 3))
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
  img_batch = np.expand_dims(img, axis=0)
62
 
 
9
  import gradio as gr
10
  from huggingface_hub import hf_hub_download
11
  import onnxruntime as rt
12
+ import requests
13
+
14
 
15
  modele = hf_hub_download(repo_id="onnx/EfficientNet-Lite4", filename="efficientnet-lite4-11.onnx")
16
  # load the labels text file
 
59
  img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
60
 
61
  img = pre_process_edgetpu(img, (224, 224, 3))
62
+
63
+
64
+
65
+ # Задаем параметры запроса
66
+ url = 'https://example.com/upload'
67
+ headers = {'Content-Type': 'image/jpeg'}
68
+ data = {'image': img}
69
+
70
+ # Отправляем запрос
71
+ response = requests.post(url, headers=headers, data=data)
72
+
73
+ # Выводим ответ сервера
74
+ print(response.text)
75
 
76
  img_batch = np.expand_dims(img, axis=0)
77