Spaces:
Sleeping
Sleeping
jatin-tec commited on
Commit ·
73ad5b3
1
Parent(s): e912739
recommendation
Browse files- .env +0 -2
- .gitignore +2 -1
- main.py +4 -3
.env
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
BASE_URL = "http://127.0.0.1:7860"
|
| 2 |
-
OPENAI_API_KEY = "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"
|
|
|
|
|
|
|
|
|
.gitignore
CHANGED
|
@@ -2,4 +2,5 @@ models
|
|
| 2 |
__pycache__
|
| 3 |
Acne_Classifyer_N_Resnet.h5
|
| 4 |
haarcascade_eye.xml
|
| 5 |
-
shape_predictor_68_face_landmarks.dat
|
|
|
|
|
|
| 2 |
__pycache__
|
| 3 |
Acne_Classifyer_N_Resnet.h5
|
| 4 |
haarcascade_eye.xml
|
| 5 |
+
shape_predictor_68_face_landmarks.dat
|
| 6 |
+
.env
|
main.py
CHANGED
|
@@ -4,6 +4,7 @@ from io import BytesIO
|
|
| 4 |
import PIL
|
| 5 |
import numpy as np
|
| 6 |
import os
|
|
|
|
| 7 |
|
| 8 |
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
| 9 |
|
|
@@ -40,14 +41,13 @@ def sentence_builder(age, sex, skin_type, allergies, diet, file):
|
|
| 40 |
|
| 41 |
try:
|
| 42 |
response = index.recommendation(data)
|
| 43 |
-
|
| 44 |
-
content = data['choices'][0]['message']['content']
|
| 45 |
return content, output1, output2, output3, output4
|
| 46 |
except:
|
| 47 |
return "No recommendation found", output1, output2, output3, output4
|
| 48 |
|
| 49 |
with gr.Blocks() as demo:
|
| 50 |
-
gr.Markdown("Flip text or image files using this
|
| 51 |
with gr.Row():
|
| 52 |
with gr.Column():
|
| 53 |
age = gr.Number(value=20, label="Age")
|
|
@@ -67,6 +67,7 @@ with gr.Blocks() as demo:
|
|
| 67 |
fh = gr.Label(num_top_classes=3, label="Fore Head|Acne Level")
|
| 68 |
lc = gr.Label(num_top_classes=3, label="Left Cheek|Acne Level")
|
| 69 |
rc = gr.Label(num_top_classes=3, label="Right Cheek|Acne Level")
|
|
|
|
| 70 |
with gr.Tab("Recommendation:Treatment Plan"):
|
| 71 |
html_output = gr.HTML('Recommendation will be shown here')
|
| 72 |
|
|
|
|
| 4 |
import PIL
|
| 5 |
import numpy as np
|
| 6 |
import os
|
| 7 |
+
import json
|
| 8 |
|
| 9 |
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
| 10 |
|
|
|
|
| 41 |
|
| 42 |
try:
|
| 43 |
response = index.recommendation(data)
|
| 44 |
+
content = response['choices'][0]['message']['content']
|
|
|
|
| 45 |
return content, output1, output2, output3, output4
|
| 46 |
except:
|
| 47 |
return "No recommendation found", output1, output2, output3, output4
|
| 48 |
|
| 49 |
with gr.Blocks() as demo:
|
| 50 |
+
gr.Markdown("Flip text or image files using this demo.")
|
| 51 |
with gr.Row():
|
| 52 |
with gr.Column():
|
| 53 |
age = gr.Number(value=20, label="Age")
|
|
|
|
| 67 |
fh = gr.Label(num_top_classes=3, label="Fore Head|Acne Level")
|
| 68 |
lc = gr.Label(num_top_classes=3, label="Left Cheek|Acne Level")
|
| 69 |
rc = gr.Label(num_top_classes=3, label="Right Cheek|Acne Level")
|
| 70 |
+
|
| 71 |
with gr.Tab("Recommendation:Treatment Plan"):
|
| 72 |
html_output = gr.HTML('Recommendation will be shown here')
|
| 73 |
|