Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- image_to_text.py +2 -2
image_to_text.py
CHANGED
|
@@ -124,7 +124,7 @@ class LlamaEvaluator(ImageEvaluator):
|
|
| 124 |
else:
|
| 125 |
# Fallback prompt
|
| 126 |
return "A beautiful image with vibrant colors and detailed composition"
|
| 127 |
-
|
| 128 |
def analyze_differences(self, generated_img: Image.Image, target_img: Image.Image) -> Dict[str, Any]:
|
| 129 |
"""Analyze differences between generated and target images."""
|
| 130 |
analysis_prompt = """
|
|
@@ -185,7 +185,7 @@ class LlamaEvaluator(ImageEvaluator):
|
|
| 185 |
"raw_analysis": response_text,
|
| 186 |
"note": "JSON parsing failed, using fallback analysis"
|
| 187 |
}
|
| 188 |
-
|
| 189 |
def describe_image(self, image: Image.Image, custom_prompt: str = None) -> str:
|
| 190 |
"""Generate a detailed description of an image."""
|
| 191 |
if not custom_prompt:
|
|
|
|
| 124 |
else:
|
| 125 |
# Fallback prompt
|
| 126 |
return "A beautiful image with vibrant colors and detailed composition"
|
| 127 |
+
@weave.op()
|
| 128 |
def analyze_differences(self, generated_img: Image.Image, target_img: Image.Image) -> Dict[str, Any]:
|
| 129 |
"""Analyze differences between generated and target images."""
|
| 130 |
analysis_prompt = """
|
|
|
|
| 185 |
"raw_analysis": response_text,
|
| 186 |
"note": "JSON parsing failed, using fallback analysis"
|
| 187 |
}
|
| 188 |
+
@weave.op()
|
| 189 |
def describe_image(self, image: Image.Image, custom_prompt: str = None) -> str:
|
| 190 |
"""Generate a detailed description of an image."""
|
| 191 |
if not custom_prompt:
|