Spaces:
Sleeping
Sleeping
debug
Browse files
app.py
CHANGED
|
@@ -62,15 +62,12 @@ def calculate_sphere_volume(width, height):
|
|
| 62 |
Diameter = rata-rata dari width dan height
|
| 63 |
"""
|
| 64 |
try:
|
| 65 |
-
# Diameter sebagai rata-rata dari width dan height (dalam pixel)
|
| 66 |
diameter = (width + height) / 2
|
| 67 |
radius = diameter / 2
|
| 68 |
-
|
| 69 |
-
# Rumus volume bola
|
| 70 |
volume = (4/3) * math.pi * (radius ** 3)
|
| 71 |
-
|
| 72 |
return round(volume, 2)
|
| 73 |
-
except:
|
|
|
|
| 74 |
return None
|
| 75 |
|
| 76 |
@app.post("/inference_volume")
|
|
|
|
| 62 |
Diameter = rata-rata dari width dan height
|
| 63 |
"""
|
| 64 |
try:
|
|
|
|
| 65 |
diameter = (width + height) / 2
|
| 66 |
radius = diameter / 2
|
|
|
|
|
|
|
| 67 |
volume = (4/3) * math.pi * (radius ** 3)
|
|
|
|
| 68 |
return round(volume, 2)
|
| 69 |
+
except Exception as e:
|
| 70 |
+
print(f"Terjadi error: {e}")
|
| 71 |
return None
|
| 72 |
|
| 73 |
@app.post("/inference_volume")
|