OppaAI commited on
Commit
f745b5c
·
verified ·
1 Parent(s): a43145e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -59,18 +59,16 @@ async def process_webcam_stream_async(image, oauth_token: gr.OAuthToken | None):
59
 
60
  # Extract all fields
61
  description_out = vlm_result.get("description", "")
62
- human_out = vlm_result.get("human", "")
63
  environment_out = vlm_result.get("environment", "")
64
  indoor_outdoor_out = vlm_result.get("indoor_or_outdoor", "")
65
  lighting_condition_out = vlm_result.get("lighting_condition", "")
66
- animals_list = vlm_result.get("animals", [])
67
- hazards_list = vlm_result.get("hazards", [])
68
  objects_list = vlm_result.get("objects", [])
 
69
 
70
  # Convert lists to strings
71
  objects_str = ", ".join(objects_list) if isinstance(objects_list, list) else str(objects_list)
72
- animals_str = ", ".join(animals_list) if isinstance(animals_list, list) else str(animals_list)
73
- hazards_str = ", ".join(hazards_list) if isinstance(hazards_list, list) else str(hazards_list)
74
 
75
  return (
76
  description_out,
@@ -78,9 +76,9 @@ async def process_webcam_stream_async(image, oauth_token: gr.OAuthToken | None):
78
  indoor_outdoor_out,
79
  lighting_condition_out,
80
  human_out,
81
- animals_str,
82
  objects_str,
83
- hazards_str
84
  )
85
 
86
  except Exception as e:
 
59
 
60
  # Extract all fields
61
  description_out = vlm_result.get("description", "")
 
62
  environment_out = vlm_result.get("environment", "")
63
  indoor_outdoor_out = vlm_result.get("indoor_or_outdoor", "")
64
  lighting_condition_out = vlm_result.get("lighting_condition", "")
65
+ human_out = vlm_result.get("human", "")
66
+ animals_out = vlm_result.get("animals", "")
67
  objects_list = vlm_result.get("objects", [])
68
+ hazards_out = vlm_result.get("hazards", "")
69
 
70
  # Convert lists to strings
71
  objects_str = ", ".join(objects_list) if isinstance(objects_list, list) else str(objects_list)
 
 
72
 
73
  return (
74
  description_out,
 
76
  indoor_outdoor_out,
77
  lighting_condition_out,
78
  human_out,
79
+ animals_out,
80
  objects_str,
81
+ hazards_out
82
  )
83
 
84
  except Exception as e: