Spaces:
Runtime error
Runtime error
✨ feat(image prediction): add noise and sharpen settings to augment methods
Browse files- parameter augment_methods: renamed to take a list of transformations for diverse image pre-processing
- added noise_level and sharpen_strength: parameters and applied them in augment_method [img processing]
app.py
CHANGED
|
@@ -200,9 +200,9 @@ def generate_results_html(results):
|
|
| 200 |
"""
|
| 201 |
return html_content
|
| 202 |
|
| 203 |
-
def predict_image_with_html(img, confidence_threshold,
|
| 204 |
-
if
|
| 205 |
-
img_pil, _ = augment_image(img,
|
| 206 |
else:
|
| 207 |
img_pil = img
|
| 208 |
img_pil, results = predict_image(img_pil, confidence_threshold)
|
|
|
|
| 200 |
"""
|
| 201 |
return html_content
|
| 202 |
|
| 203 |
+
def predict_image_with_html(img, confidence_threshold, augment_methods, rotate_degrees, noise_level, sharpen_strength):
|
| 204 |
+
if augment_methods:
|
| 205 |
+
img_pil, _ = augment_image(img, augment_methods, rotate_degrees, noise_level, sharpen_strength)
|
| 206 |
else:
|
| 207 |
img_pil = img
|
| 208 |
img_pil, results = predict_image(img_pil, confidence_threshold)
|