hamdanhh07 commited on
Commit
616d5a8
1 Parent(s): 81e54ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -5,11 +5,18 @@ example_list = [['examples/cov1.png'],
5
  ['examples/nor2.jpg'],
6
  ['examples/penu1.jpg'],
7
  ['examples/penu2.jpg']]
8
- from huggingface_hub.inference_api import InferenceApi
9
 
10
- inference = InferenceApi(repo_id="hamdan07/UltraSound-Lung", token="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")
 
 
 
 
 
 
 
11
 
12
  title = "COVID-19 Detection in Ultrasound Imagery Using Artificial intelligent Methods"
13
  description = "[Trained on european car plates] Identifies the license plate, cuts and displays it, and converts it into text. An image with higher resolution and clearer license plate will have a better accuracy."
14
 
15
- gr.Interface.load("inference",examples=example_list,title=title,description=description).launch(debug=False,share=False)
 
5
  ['examples/nor2.jpg'],
6
  ['examples/penu1.jpg'],
7
  ['examples/penu2.jpg']]
8
+ import requests
9
 
10
+ API_URL = "https://api-inference.huggingface.co/models/hamdan07/UltraSound-Lung"
11
+ headers = {"Authorization": "Bearer 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"}
12
+
13
+ def query(filename):
14
+ with open(filename, "rb") as f:
15
+ data = f.read()
16
+ response = requests.post(API_URL, headers=headers, data=data)
17
+ return response.json()
18
 
19
  title = "COVID-19 Detection in Ultrasound Imagery Using Artificial intelligent Methods"
20
  description = "[Trained on european car plates] Identifies the license plate, cuts and displays it, and converts it into text. An image with higher resolution and clearer license plate will have a better accuracy."
21
 
22
+ gr.Interface.load("models/hamdan07/UltraSound-Lung"),examples=example_list,title=title,description=description).launch(debug=False,share=False)