Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,7 @@ def detect_objects(image):
|
|
26 |
|
27 |
try:
|
28 |
# Lakukan prediksi pada gambar
|
29 |
-
predictions = model.predict(temp_file_path, confidence=
|
30 |
|
31 |
# Menghitung jumlah objek per kelas
|
32 |
class_count = {}
|
@@ -45,7 +45,7 @@ def detect_objects(image):
|
|
45 |
|
46 |
# Menyimpan gambar dengan prediksi
|
47 |
output_image_path = "/tmp/prediction.jpg"
|
48 |
-
model.predict(temp_file_path, confidence=
|
49 |
|
50 |
except requests.exceptions.HTTPError as http_err:
|
51 |
# Menangani kesalahan HTTP
|
|
|
26 |
|
27 |
try:
|
28 |
# Lakukan prediksi pada gambar
|
29 |
+
predictions = model.predict(temp_file_path, confidence=60, overlap=80).json()
|
30 |
|
31 |
# Menghitung jumlah objek per kelas
|
32 |
class_count = {}
|
|
|
45 |
|
46 |
# Menyimpan gambar dengan prediksi
|
47 |
output_image_path = "/tmp/prediction.jpg"
|
48 |
+
model.predict(temp_file_path, confidence=60, overlap=80).save(output_image_path)
|
49 |
|
50 |
except requests.exceptions.HTTPError as http_err:
|
51 |
# Menangani kesalahan HTTP
|