Spaces:
Running
on
Zero
Running
on
Zero
Update scene_analyzer.py
Browse files- scene_analyzer.py +2 -2
scene_analyzer.py
CHANGED
@@ -31,7 +31,7 @@ class SceneAnalyzer:
|
|
31 |
self.descriptor = SceneDescriptor(scene_types=self.SCENE_TYPES, object_categories=self.OBJECT_CATEGORIES)
|
32 |
self.scene_describer = EnhancedSceneDescriber(scene_types=self.SCENE_TYPES)
|
33 |
|
34 |
-
# 初始化 CLIP
|
35 |
try:
|
36 |
self.clip_analyzer = CLIPAnalyzer()
|
37 |
self.use_clip = True
|
@@ -248,7 +248,7 @@ class SceneAnalyzer:
|
|
248 |
"lighting_conditions": lighting_info or {"time_of_day": "unknown", "confidence": 0}
|
249 |
}
|
250 |
|
251 |
-
# 添加 CLIP
|
252 |
if clip_analysis and "error" not in clip_analysis:
|
253 |
result["clip_analysis"] = {
|
254 |
"top_scene": clip_analysis.get("top_scene", ("unknown", 0)),
|
|
|
31 |
self.descriptor = SceneDescriptor(scene_types=self.SCENE_TYPES, object_categories=self.OBJECT_CATEGORIES)
|
32 |
self.scene_describer = EnhancedSceneDescriber(scene_types=self.SCENE_TYPES)
|
33 |
|
34 |
+
# 初始化 CLIP 分析器
|
35 |
try:
|
36 |
self.clip_analyzer = CLIPAnalyzer()
|
37 |
self.use_clip = True
|
|
|
248 |
"lighting_conditions": lighting_info or {"time_of_day": "unknown", "confidence": 0}
|
249 |
}
|
250 |
|
251 |
+
# 添加 CLIP 特定的結果
|
252 |
if clip_analysis and "error" not in clip_analysis:
|
253 |
result["clip_analysis"] = {
|
254 |
"top_scene": clip_analysis.get("top_scene", ("unknown", 0)),
|