Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ def detect_objects(image):
|
|
16 |
temp_file_path = temp_file.name
|
17 |
|
18 |
# Lakukan prediksi pada gambar
|
19 |
-
predictions = model.predict(temp_file_path, confidence=
|
20 |
|
21 |
# Menghitung jumlah objek per kelas
|
22 |
class_count = {}
|
@@ -39,7 +39,7 @@ def detect_objects(image):
|
|
39 |
result_text += f"\nTotal Product Nestle: {total_count}"
|
40 |
|
41 |
# Menyimpan gambar dengan prediksi
|
42 |
-
output_image = model.predict(temp_file_path, confidence=
|
43 |
|
44 |
# Hapus file sementara setelah prediksi
|
45 |
os.remove(temp_file_path)
|
|
|
16 |
temp_file_path = temp_file.name
|
17 |
|
18 |
# Lakukan prediksi pada gambar
|
19 |
+
predictions = model.predict(temp_file_path, confidence=60, overlap=80).json()
|
20 |
|
21 |
# Menghitung jumlah objek per kelas
|
22 |
class_count = {}
|
|
|
39 |
result_text += f"\nTotal Product Nestle: {total_count}"
|
40 |
|
41 |
# Menyimpan gambar dengan prediksi
|
42 |
+
output_image = model.predict(temp_file_path, confidence=60, overlap=80).save("/tmp/prediction.jpg")
|
43 |
|
44 |
# Hapus file sementara setelah prediksi
|
45 |
os.remove(temp_file_path)
|