Spaces:
Sleeping
Sleeping
Update MeAI_Maincode/Detectskindisease.py
Browse files
MeAI_Maincode/Detectskindisease.py
CHANGED
@@ -4,7 +4,7 @@ from PIL import Image
|
|
4 |
import io
|
5 |
import numpy as np
|
6 |
import os
|
7 |
-
key = "
|
8 |
trans_disease = {
|
9 |
"acne": "m峄",
|
10 |
"actinic_keratosis": "ch峄﹏g d脿y s峄玭g quang h贸a",
|
@@ -88,12 +88,12 @@ def detect_skin_disease(image,key):
|
|
88 |
img.save(img_byte_array, format='PNG')
|
89 |
img_byte_array.seek(0)
|
90 |
|
91 |
-
url = "https://detect-skin-
|
92 |
# files = {"image": img_byte_array}
|
93 |
files = {"image": ("image.png", img_byte_array, "image/png")}
|
94 |
headers = {
|
95 |
"X-RapidAPI-Key": key,
|
96 |
-
"X-RapidAPI-Host": "detect-skin-
|
97 |
}
|
98 |
response = requests.post(url, files=files, headers=headers)
|
99 |
response_json = response.json()
|
@@ -126,7 +126,7 @@ def detect_skin_disease(image,key):
|
|
126 |
except Exception as e:
|
127 |
return f"Error: {str(e)}"
|
128 |
|
129 |
-
def create_skin_tab(skinkey="
|
130 |
css = """
|
131 |
.textboxskin {
|
132 |
font-sxxxxize: 50px; !important;
|
|
|
4 |
import io
|
5 |
import numpy as np
|
6 |
import os
|
7 |
+
key = "2cff2aab49msh5191ef59693cc02p1091a7jsnd7100bb29621"
|
8 |
trans_disease = {
|
9 |
"acne": "m峄",
|
10 |
"actinic_keratosis": "ch峄﹏g d脿y s峄玭g quang h贸a",
|
|
|
88 |
img.save(img_byte_array, format='PNG')
|
89 |
img_byte_array.seek(0)
|
90 |
|
91 |
+
url = "https://detect-skin-disease.p.rapidapi.com/facebody/analysis/detect-skin-disease"
|
92 |
# files = {"image": img_byte_array}
|
93 |
files = {"image": ("image.png", img_byte_array, "image/png")}
|
94 |
headers = {
|
95 |
"X-RapidAPI-Key": key,
|
96 |
+
"X-RapidAPI-Host": "detect-skin-disease.p.rapidapi.com"
|
97 |
}
|
98 |
response = requests.post(url, files=files, headers=headers)
|
99 |
response_json = response.json()
|
|
|
126 |
except Exception as e:
|
127 |
return f"Error: {str(e)}"
|
128 |
|
129 |
+
def create_skin_tab(skinkey="2cff2aab49msh5191ef59693cc02p1091a7jsnd7100bb29621"):
|
130 |
css = """
|
131 |
.textboxskin {
|
132 |
font-sxxxxize: 50px; !important;
|