Compare commits
2 Commits
3c50fc4d0e
...
68250e8069
| Author | SHA1 | Date | |
|---|---|---|---|
| 68250e8069 | |||
| fe31ac978a |
@@ -5,7 +5,7 @@ import shared.config as config
|
||||
|
||||
class DishSafetyResult(BaseModel):
|
||||
visible_objects: list[str] = Field(
|
||||
description="List EVERY distinct item visible in the frame (e.g., ['ceramic bowl', 'rice', 'metal spoon handle', 'stew'])."
|
||||
description="List EVERY distinct item visible in the frame, one item per list element (e.g., ['ceramic bowl', 'rice', 'metal spoon handle', 'stew'])."
|
||||
)
|
||||
is_safe: bool = Field(
|
||||
description="Is the microwave dish safe to microwave? True if safe, False if unsafe."
|
||||
@@ -22,9 +22,9 @@ def check_dish_safety(image_path: str) -> dict:
|
||||
"You are an expert microwave safety quality inspector analyzing a top-down camera frame.\n\n"
|
||||
"INSPECTION STEPS:\n"
|
||||
"Describe what you see in the image, identify any viewable hazards, and determine if the dish is safe to microwave.\n"
|
||||
"Alert only if the cooking of the dish **will cause damage** to the microwave or the dish itself.\n"
|
||||
"Alert only if the cooking of the dish **will cause damage** to the microwave or the dish itself, like metallic objects.\n\n"
|
||||
"NOTES:\n"
|
||||
"The camera focus is wrongly setup, so the image may be blurry. Please do not take the blurriness or lack of view into a hazardn"
|
||||
"The camera focus is wrongly setup, so the image may be blurry. Please do not take the blurriness or lack of view into a hazard"
|
||||
)
|
||||
|
||||
response_raw = generate(
|
||||
@@ -33,7 +33,8 @@ def check_dish_safety(image_path: str) -> dict:
|
||||
output_format=DishSafetyResult,
|
||||
should_think=False,
|
||||
)
|
||||
print(f"[Debug] Raw response from AI generator: {response_raw}")
|
||||
if config.DEBUG_MESSAGES:
|
||||
print(f"[Debug] Raw response from AI generator: {response_raw}")
|
||||
|
||||
if isinstance(response_raw, str):
|
||||
try:
|
||||
|
||||
@@ -689,7 +689,7 @@ async def request_cloud_cooking_plan(microwave_id, sensors_data):
|
||||
print(f"[{microwave_id}] Cloud Plan Received! Starting microwave: {c_time}s @ {c_power}W")
|
||||
microwave_states[microwave_id].set_state(MicrowaveState.COOKING)
|
||||
|
||||
if config.DEBUG:
|
||||
if config.DEBUG_SHORTER_COOKING_PLAN:
|
||||
c_time = 20 # Set to 20s for debug
|
||||
c_temp = 50 # Set to 50°C for debug
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
# Debugging and others
|
||||
DEBUG=True
|
||||
DEBUG_MESSAGES=True
|
||||
DEBUG_DANGEROUS_AREA=False
|
||||
DEBUG_TEMPERATURE_ALERT=False
|
||||
DEBUG_SHORTER_COOKING_PLAN=True
|
||||
|
||||
# Technitian Web Server
|
||||
TECHNICIAN_WEB_SERVER_HOST = "192.168.50.1"
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
from shared.config import DEBUG
|
||||
from shared.config import DEBUG_MESSAGES
|
||||
|
||||
def log(message):
|
||||
"""Log a message to the console if DEBUG is enabled."""
|
||||
if DEBUG:
|
||||
if DEBUG_MESSAGES:
|
||||
print(f"\n{message}")
|
||||
Reference in New Issue
Block a user