Multiple enhacements
Browse files- Dockerfile +1 -1
- app.py +90 -70
- descriptions.py +167 -0
Dockerfile
CHANGED
|
@@ -7,7 +7,7 @@ WORKDIR /usr/src/app
|
|
| 7 |
COPY app.py .
|
| 8 |
COPY lambdas.py .
|
| 9 |
COPY requirements.txt .
|
| 10 |
-
|
| 11 |
# Installations
|
| 12 |
RUN apt-get update && apt-get install libzbar0 -y && pip install pyzbar
|
| 13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
|
|
| 7 |
COPY app.py .
|
| 8 |
COPY lambdas.py .
|
| 9 |
COPY requirements.txt .
|
| 10 |
+
COPY descriptions.py .
|
| 11 |
# Installations
|
| 12 |
RUN apt-get update && apt-get install libzbar0 -y && pip install pyzbar
|
| 13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
app.py
CHANGED
|
@@ -7,22 +7,11 @@ from PIL import Image
|
|
| 7 |
import pandas as pd
|
| 8 |
import os.path
|
| 9 |
import numpy as np
|
|
|
|
|
|
|
| 10 |
|
| 11 |
DEBUG = True
|
| 12 |
|
| 13 |
-
prefer_frontal_cam_html = """
|
| 14 |
-
<script>
|
| 15 |
-
const originalGetUserMedia = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);
|
| 16 |
-
|
| 17 |
-
navigator.mediaDevices.getUserMedia = (constraints) => {
|
| 18 |
-
if (!constraints.video.facingMode) {
|
| 19 |
-
constraints.video.facingMode = {ideal: "environment"};
|
| 20 |
-
}
|
| 21 |
-
return originalGetUserMedia(constraints);
|
| 22 |
-
};
|
| 23 |
-
</script>
|
| 24 |
-
"""
|
| 25 |
-
|
| 26 |
config = {'possible_shifts': {'No shifts': 0}, 'possible_modes': ["waste"]}
|
| 27 |
|
| 28 |
|
|
@@ -52,26 +41,32 @@ def login(username, password) -> bool:
|
|
| 52 |
'possible_modes': possible_modes,
|
| 53 |
'possible_shifts': possible_shifts,
|
| 54 |
}
|
|
|
|
| 55 |
config.update(config_aux)
|
| 56 |
|
| 57 |
return True
|
| 58 |
return False
|
| 59 |
|
| 60 |
|
| 61 |
-
def start_app(shift_id, mode):
|
| 62 |
try:
|
| 63 |
-
config_aux = {'
|
| 64 |
-
'
|
|
|
|
|
|
|
|
|
|
| 65 |
config.update(config_aux)
|
| 66 |
-
gr.Info('Loading models'
|
| 67 |
status_code, r = upload_models(**config)
|
| 68 |
if status_code in (201, 200, 204):
|
|
|
|
| 69 |
gr.Info('Models Correctly Loaded. Ready to predict')
|
|
|
|
| 70 |
else:
|
| 71 |
raise gr.Error(f'Error loading the models: {r}')
|
| 72 |
-
config.update(r)
|
| 73 |
except Exception as e:
|
| 74 |
raise gr.Error(f'Error Uploading the models. \n {e}')
|
|
|
|
| 75 |
|
| 76 |
|
| 77 |
def predict_app(image, patient_id):
|
|
@@ -89,58 +84,83 @@ def predict_app(image, patient_id):
|
|
| 89 |
|
| 90 |
|
| 91 |
# APP
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
|
| 93 |
-
with gr.Blocks(head=prefer_frontal_cam_html) as block:
|
| 94 |
-
with gr.Tab(label='Welcome'):
|
| 95 |
-
@gr.render()
|
| 96 |
-
def render_dropdowns():
|
| 97 |
-
gr.Markdown(f'# User: {config.get("restaurant_name", "Proppos")}')
|
| 98 |
-
|
| 99 |
-
shift_dropdown = gr.Dropdown(label='Meal/Comida/Apat',
|
| 100 |
-
value=list(config["possible_shifts"].items())[0],
|
| 101 |
-
choices=tuple(config["possible_shifts"].items()))
|
| 102 |
-
mode_dropdown = gr.Dropdown(label='Mode',
|
| 103 |
-
value=config['possible_modes'][0],
|
| 104 |
-
choices=config["possible_modes"])
|
| 105 |
-
start_button = gr.Button(value='START')
|
| 106 |
-
start_button.click(fn=start_app, inputs=[shift_dropdown, mode_dropdown])
|
| 107 |
-
gr.LogoutButton()
|
| 108 |
-
|
| 109 |
-
with gr.Tab(label='📷 Capture'):
|
| 110 |
-
# MAIN TAB TO PREDICT
|
| 111 |
-
gr.Markdown(f""" 1. Click to Access Webcam
|
| 112 |
-
2.
|
| 113 |
-
""")
|
| 114 |
-
im = gr.Image(sources=['webcam'], streaming=True, mirror_webcam=False, type='pil',
|
| 115 |
-
height=720, width=1280)
|
| 116 |
-
with gr.Accordion():
|
| 117 |
-
eater_id = gr.Textbox(label='Patient Identification', placeholder='Searching Patient ID')
|
| 118 |
-
|
| 119 |
-
current_eater_id = {'value': None}
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
@gr.on(inputs=im, outputs=eater_id)
|
| 123 |
-
def search_eater_id(image):
|
| 124 |
-
d = decode(image)
|
| 125 |
-
default_value = None
|
| 126 |
-
current_value = current_eater_id['value'] or default_value
|
| 127 |
-
new_value = d[0].data if d else default_value
|
| 128 |
-
# If it is really a new value different from the default one, change it.
|
| 129 |
-
final_value = new_value if new_value != default_value else current_value
|
| 130 |
-
current_eater_id['value'] = final_value
|
| 131 |
-
return final_value
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
b = gr.Button('PRESS TO PREDICT')
|
| 135 |
-
b.click(fn=predict_app, inputs=[im, eater_id], outputs=gr.Info())
|
| 136 |
-
|
| 137 |
-
with gr.Tab(label='ℹ️ Status'):
|
| 138 |
-
gr.Markdown(' Press the button to see the status of the Application and technical information')
|
| 139 |
-
load_status_button = gr.Button('Load Status')
|
| 140 |
-
status_json = gr.Json(label='Status')
|
| 141 |
-
load_status_button.click(fn=lambda: config, outputs=status_json)
|
| 142 |
-
|
| 143 |
-
with gr.Tab(label='📄 Documentation'):
|
| 144 |
-
gr.Markdown()
|
| 145 |
|
| 146 |
block.launch(show_api=False, auth=login)
|
|
|
|
| 7 |
import pandas as pd
|
| 8 |
import os.path
|
| 9 |
import numpy as np
|
| 10 |
+
from datetime import datetime, timedelta
|
| 11 |
+
from descriptions import prefer_frontal_cam_html, docu_eng, docu_cat
|
| 12 |
|
| 13 |
DEBUG = True
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
config = {'possible_shifts': {'No shifts': 0}, 'possible_modes': ["waste"]}
|
| 16 |
|
| 17 |
|
|
|
|
| 41 |
'possible_modes': possible_modes,
|
| 42 |
'possible_shifts': possible_shifts,
|
| 43 |
}
|
| 44 |
+
config.clear()
|
| 45 |
config.update(config_aux)
|
| 46 |
|
| 47 |
return True
|
| 48 |
return False
|
| 49 |
|
| 50 |
|
| 51 |
+
def start_app(shift_id, mode, date):
|
| 52 |
try:
|
| 53 |
+
config_aux = {'date': date,
|
| 54 |
+
'shift_id': shift_id,
|
| 55 |
+
'mode': mode,
|
| 56 |
+
'possible_shifts': {'No shifts': 0},
|
| 57 |
+
'possible_modes': ["waste"]}
|
| 58 |
config.update(config_aux)
|
| 59 |
+
gr.Info('Loading models. This may take a while')
|
| 60 |
status_code, r = upload_models(**config)
|
| 61 |
if status_code in (201, 200, 204):
|
| 62 |
+
config.update(r)
|
| 63 |
gr.Info('Models Correctly Loaded. Ready to predict')
|
| 64 |
+
tab_id = 1
|
| 65 |
else:
|
| 66 |
raise gr.Error(f'Error loading the models: {r}')
|
|
|
|
| 67 |
except Exception as e:
|
| 68 |
raise gr.Error(f'Error Uploading the models. \n {e}')
|
| 69 |
+
return gr.Tabs(selected=tab_id, visible=True)
|
| 70 |
|
| 71 |
|
| 72 |
def predict_app(image, patient_id):
|
|
|
|
| 84 |
|
| 85 |
|
| 86 |
# APP
|
| 87 |
+
with (gr.Blocks(head=prefer_frontal_cam_html) as block):
|
| 88 |
+
with gr.Tabs() as tabs:
|
| 89 |
+
with gr.Tab(label='Welcome', id=0) as welcome_tab:
|
| 90 |
+
gr.Info('Loading ...')
|
| 91 |
+
@gr.render()
|
| 92 |
+
def header():
|
| 93 |
+
gr.Markdown(f'# User: {config.get("restaurant_name", "Proppos")}', render=True)
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
logout_button = gr.Button(icon=None, link='/logout', value='Logout / Exit ↩')
|
| 97 |
+
|
| 98 |
+
@gr.render()
|
| 99 |
+
def render_dropdowns():
|
| 100 |
+
shift_dropdown = gr.Dropdown(label='Meal/Apat/Comida',
|
| 101 |
+
value=list(config["possible_shifts"].items())[0],
|
| 102 |
+
choices=tuple(config["possible_shifts"].items()))
|
| 103 |
+
mode_dropdown = gr.Dropdown(label='Mode',
|
| 104 |
+
value=config['possible_modes'][0],
|
| 105 |
+
choices=config["possible_modes"])
|
| 106 |
+
|
| 107 |
+
days = [datetime.today().strftime('%Y-%m-%d'),
|
| 108 |
+
(datetime.now() - timedelta(days=1)).strftime('%Y-%m-%d')]
|
| 109 |
+
date_chooser = gr.Dropdown(choices=days, label='Date/Data/Fecha', value=days[0])
|
| 110 |
+
|
| 111 |
+
start_button = gr.Button(value='START ▶️')
|
| 112 |
+
start_button.click(fn=start_app, inputs=[shift_dropdown, mode_dropdown, date_chooser], outputs=tabs)
|
| 113 |
+
|
| 114 |
+
gr.Markdown(""" * Do you have any doubt? Please, see the documentation tab. \n
|
| 115 |
+
* Tens un dubte? Consulta la pestanya de documentació. """)
|
| 116 |
+
|
| 117 |
+
# logout_button.click(fn=lambda: config.clear())
|
| 118 |
+
|
| 119 |
+
with gr.Tab(label='📷 Capture', id=1):
|
| 120 |
+
# MAIN TAB TO PREDICT
|
| 121 |
+
gr.Markdown(f""" 1. Click to Access Webcam
|
| 122 |
+
2. Press the red button to start recording
|
| 123 |
+
3. Place the tray so it is centered in the displayed image and
|
| 124 |
+
4. Press the grey button 'PRESS TO PREDICT'
|
| 125 |
+
""")
|
| 126 |
+
im = gr.Image(sources=['webcam'], streaming=True, mirror_webcam=False, type='pil',
|
| 127 |
+
height=720, width=1280)
|
| 128 |
+
with gr.Accordion():
|
| 129 |
+
eater_id = gr.Textbox(label='Patient Identification', placeholder='Searching Patient ID')
|
| 130 |
+
|
| 131 |
+
current_eater_id = {'value': None}
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
@gr.on(inputs=im, outputs=eater_id)
|
| 135 |
+
def search_eater_id(image):
|
| 136 |
+
d = decode(image)
|
| 137 |
+
default_value = None
|
| 138 |
+
current_value = current_eater_id['value'] or default_value
|
| 139 |
+
new_value = d[0].data if d else default_value
|
| 140 |
+
# If it is really a new value different from the default one, change it.
|
| 141 |
+
final_value = new_value if new_value != default_value else current_value
|
| 142 |
+
current_eater_id['value'] = final_value
|
| 143 |
+
return final_value
|
| 144 |
+
|
| 145 |
+
|
| 146 |
+
b = gr.Button('PRESS TO PREDICT')
|
| 147 |
+
b.click(fn=predict_app, inputs=[im, eater_id], outputs=gr.Info())
|
| 148 |
+
|
| 149 |
+
with gr.Tab(label='ℹ️ Status', id=2):
|
| 150 |
+
gr.Markdown(' Press the button to see the status of the Application and technical information')
|
| 151 |
+
load_status_button = gr.Button('Load Status')
|
| 152 |
+
status_json = gr.Json(label='Status')
|
| 153 |
+
load_status_button.click(fn=lambda: config, outputs=status_json)
|
| 154 |
+
|
| 155 |
+
with gr.Tab(label='📄 Documentation', id=3):
|
| 156 |
+
choices = [('ENG 🇬🇧', docu_eng), ('CAT', docu_cat)]
|
| 157 |
+
c = gr.Checkboxgroup(label='Select the language', choices=choices)
|
| 158 |
+
|
| 159 |
+
@gr.render()
|
| 160 |
+
def display_docu():
|
| 161 |
+
d = gr.Markdown(docu_eng)
|
| 162 |
+
c.change(fn=lambda x: x, inputs=c, outputs=d)
|
| 163 |
+
|
| 164 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
|
| 166 |
block.launch(show_api=False, auth=login)
|
descriptions.py
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
prefer_frontal_cam_html = """
|
| 2 |
+
<script>
|
| 3 |
+
const originalGetUserMedia = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);
|
| 4 |
+
|
| 5 |
+
navigator.mediaDevices.getUserMedia = (constraints) => {
|
| 6 |
+
if (!constraints.video.facingMode) {
|
| 7 |
+
constraints.video.facingMode = {ideal: "environment"};
|
| 8 |
+
}
|
| 9 |
+
return originalGetUserMedia(constraints);
|
| 10 |
+
};
|
| 11 |
+
</script>
|
| 12 |
+
"""
|
| 13 |
+
|
| 14 |
+
docu_eng="""
|
| 15 |
+
## User Guide
|
| 16 |
+
|
| 17 |
+
This application is intended to create the multiple
|
| 18 |
+
|
| 19 |
+
Welcome to the application! This guide will help you understand how to use each feature and navigate through the different tabs.
|
| 20 |
+
|
| 21 |
+
## Quick Start
|
| 22 |
+
|
| 23 |
+
1. In the Welcome tab, select the shift the date and the mode and press START.
|
| 24 |
+
2. This will trigger the AI models that will load the workflow for the specific configuration.
|
| 25 |
+
3. Once the AI models are ready, the app will switch to the Capture tab.
|
| 26 |
+
4. Follow the steps in Capture Tab to start predicting. Once a prediction is send, an info panel will pop up saying so.
|
| 27 |
+
5. Repeat the 4th process with each tray.
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
## Overview
|
| 31 |
+
|
| 32 |
+
This AI application helps hospitals and restaurants capture images of trays, and automatically compute the food that
|
| 33 |
+
has been eaten (intake) or the food that has not (waste).
|
| 34 |
+
|
| 35 |
+
## Tabs
|
| 36 |
+
|
| 37 |
+
### 1. **Welcome Tab**
|
| 38 |
+
|
| 39 |
+
When you first log in, you'll see the Welcome tab. Here, you need to:
|
| 40 |
+
|
| 41 |
+
- **Select a Shift**: Choose the appropriate shift from the dropdown menu.
|
| 42 |
+
- **Select a Mode**: Choose the mode of operation.
|
| 43 |
+
- **Select a Date**: Choose the date for which you want to make predictions.
|
| 44 |
+
- **Start the Application**: Click the 'START ▶️' button to load the necessary models.
|
| 45 |
+
|
| 46 |
+
Once you've click start, the Capture Tab will open automatically once the AI models are ready to be used.
|
| 47 |
+
This process can take between 5 seconds to two minutes. It is specially time spending when there are many new products.
|
| 48 |
+
|
| 49 |
+
### 2. **📷 Capture Tab**
|
| 50 |
+
|
| 51 |
+
This is the main tab where you will capture images and make predictions.
|
| 52 |
+
|
| 53 |
+
1. **Access Webcam**: Click the button to turn on your webcam.
|
| 54 |
+
2. **Start Recording**: Press the red button to start recording. It is strongly suggested to hold the mobile in horizontal mode.
|
| 55 |
+
3. **Position the Tray**: Place the tray so it is centered in the displayed image.
|
| 56 |
+
4. **Predict**: Press the grey button labeled 'PRESS TO PREDICT' to make a prediction based on the captured image.
|
| 57 |
+
|
| 58 |
+
### 3. **ℹ️ Status Tab**
|
| 59 |
+
|
| 60 |
+
In this tab, you can check the current status of the application.
|
| 61 |
+
Some of the info can be pretty technical.
|
| 62 |
+
|
| 63 |
+
- **Load Status**: Press the 'Load Status' button to view technical information and the status of the application.
|
| 64 |
+
|
| 65 |
+
## Steps to Use the Application
|
| 66 |
+
|
| 67 |
+
1. **Log In**:
|
| 68 |
+
- Enter your username and password to access the app.
|
| 69 |
+
|
| 70 |
+
2. **Setup**:
|
| 71 |
+
- Go to the Welcome tab.
|
| 72 |
+
- Select your shift, mode, and date.
|
| 73 |
+
- Click 'START ▶️' to load the models.
|
| 74 |
+
|
| 75 |
+
3. **Capture and Predict**:
|
| 76 |
+
- Go to the 📷 Capture tab.
|
| 77 |
+
- Follow the instructions to capture an image using your webcam.
|
| 78 |
+
- Press 'PRESS TO PREDICT' to make a prediction.
|
| 79 |
+
|
| 80 |
+
4. **Check Status**:
|
| 81 |
+
- Go to the ℹ️ Status tab.
|
| 82 |
+
- Press 'Load Status' to view the application’s status.
|
| 83 |
+
|
| 84 |
+
## Troubleshooting
|
| 85 |
+
|
| 86 |
+
- **If you encounter issues**: Ensure your webcam is working and you have selected the correct shift, mode, and date.
|
| 87 |
+
- **For additional help**: Contact support.
|
| 88 |
+
|
| 89 |
+
Thank you for using our application! We hope this guide helps you navigate and use all the features effectively.
|
| 90 |
+
"""
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
docu_cat="""
|
| 94 |
+
## Guia d'Usuari
|
| 95 |
+
|
| 96 |
+
Aquesta aplicació està destinada a crear els múltiples
|
| 97 |
+
|
| 98 |
+
Benvingut a l'aplicació! Aquesta guia t'ajudarà a entendre com utilitzar cada funció i navegar pels diferents apartats.
|
| 99 |
+
|
| 100 |
+
## Inici Ràpid
|
| 101 |
+
|
| 102 |
+
1. A la pestanya de Benvinguda, selecciona el torn, la data i el mode i prem INICI.
|
| 103 |
+
2. Això activarà els models d'IA que carregaran el flux de treball per a la configuració específica.
|
| 104 |
+
3. Un cop els models d'IA estiguin a punt, l'aplicació passarà a la pestanya de Captura.
|
| 105 |
+
4. Segueix els passos a la pestanya de Captura per començar a predir. Un cop s'hagi enviat una predicció, apareixerà un panell d'informació indicant-ho.
|
| 106 |
+
5. Repeteix el procés del punt 4 amb cada safata.
|
| 107 |
+
|
| 108 |
+
## Descripció General
|
| 109 |
+
|
| 110 |
+
Aquesta aplicació d'IA ajuda hospitals i restaurants a capturar imatges de safates, i calcular automàticament el menjar que s'ha menjat (ingesta) o el menjar que no s'ha menjat (residus).
|
| 111 |
+
|
| 112 |
+
## Pestanyes
|
| 113 |
+
|
| 114 |
+
### 1. **Pestanya de Benvinguda**
|
| 115 |
+
|
| 116 |
+
Quan iniciïs sessió, veuràs la pestanya de Benvinguda. Aquí, has de:
|
| 117 |
+
|
| 118 |
+
- **Seleccionar un Torn**: Tria el torn apropiat del menú desplegable.
|
| 119 |
+
- **Seleccionar un Mode**: Tria el mode d'operació.
|
| 120 |
+
- **Seleccionar una Data**: Tria la data per a la qual vols fer prediccions.
|
| 121 |
+
- **Iniciar l'Aplicació**: Fes clic al botó 'INICI ▶️' per carregar els models necessaris.
|
| 122 |
+
|
| 123 |
+
Un cop hagis fet clic a iniciar, la pestanya de Captura s'obrirà automàticament un cop els models d'IA estiguin a punt per ser utilitzats.
|
| 124 |
+
Aquest procés pot trigar entre 5 segons i dos minuts. És especialment llarg quan hi ha molts productes nous.
|
| 125 |
+
|
| 126 |
+
### 2. **📷 Pestanya de Captura**
|
| 127 |
+
|
| 128 |
+
Aquesta és la pestanya principal on capturaràs imatges i faràs prediccions.
|
| 129 |
+
|
| 130 |
+
1. **Accedir a la Càmera Web**: Fes clic al botó per activar la teva càmera web.
|
| 131 |
+
2. **Començar a Gravar**: Prem el botó vermell per començar a gravar. Es recomana fermament mantenir el mòbil en mode horitzontal.
|
| 132 |
+
3. **Posicionar la Safata**: Col·loca la safata de manera que quedi centrada a la imatge mostrada.
|
| 133 |
+
4. **Predir**: Prem el botó gris etiquetat com 'PREMEU PER PREDIR' per fer una predicció basada en la imatge capturada.
|
| 134 |
+
|
| 135 |
+
### 3. **ℹ️ Pestanya d'Estat**
|
| 136 |
+
|
| 137 |
+
En aquesta pestanya, pots comprovar l'estat actual de l'aplicació.
|
| 138 |
+
Alguna de la informació pot ser tècnica.
|
| 139 |
+
|
| 140 |
+
- **Carregar Estat**: Prem el botó 'Carregar Estat' per veure informació tècnica i l'estat de l'aplicació.
|
| 141 |
+
|
| 142 |
+
## Passos per Utilitzar l'Aplicació
|
| 143 |
+
|
| 144 |
+
1. **Iniciar Sessió**:
|
| 145 |
+
- Introdueix el teu nom d'usuari i contrasenya per accedir a l'aplicació.
|
| 146 |
+
|
| 147 |
+
2. **Configuració**:
|
| 148 |
+
- Ves a la pestanya de Benvinguda.
|
| 149 |
+
- Selecciona el torn, mode i data.
|
| 150 |
+
- Fes clic a 'INICI ▶️' per carregar els models.
|
| 151 |
+
|
| 152 |
+
3. **Captura i Predicció**:
|
| 153 |
+
- Ves a la pestanya 📷 Captura.
|
| 154 |
+
- Segueix les instruccions per capturar una imatge amb la teva càmera web.
|
| 155 |
+
- Prem 'PREMEU PER PREDIR' per fer una predicció.
|
| 156 |
+
|
| 157 |
+
4. **Comprovar l'Estat**:
|
| 158 |
+
- Ves a la pestanya ℹ️ Estat.
|
| 159 |
+
- Prem 'Carregar Estat' per veure l'estat de l'aplicació.
|
| 160 |
+
|
| 161 |
+
## Resolució de Problemes
|
| 162 |
+
|
| 163 |
+
- **Si tens problemes**: Assegura't que la teva càmera web està funcionant i has seleccionat el torn, mode i data correctes.
|
| 164 |
+
- **Per a ajuda addicional**: Contacta amb el suport tècnic.
|
| 165 |
+
|
| 166 |
+
Gràcies per utilitzar la nostra aplicació! Esperem que aquesta guia t'ajudi a navegar i utilitzar totes les funcions de manera efectiva.
|
| 167 |
+
"""
|