Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ import os
|
|
6 |
# Inisialisasi Roboflow
|
7 |
rf = Roboflow(api_key="Otg64Ra6wNOgDyjuhMYU")
|
8 |
project = rf.workspace("alat-pelindung-diri").project("nescafe-4base")
|
9 |
-
model = project.version(
|
10 |
|
11 |
# Fungsi untuk menangani input dan output gambar
|
12 |
def detect_objects(image):
|
@@ -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 = {}
|
|
|
6 |
# Inisialisasi Roboflow
|
7 |
rf = Roboflow(api_key="Otg64Ra6wNOgDyjuhMYU")
|
8 |
project = rf.workspace("alat-pelindung-diri").project("nescafe-4base")
|
9 |
+
model = project.version(16).model
|
10 |
|
11 |
# Fungsi untuk menangani input dan output gambar
|
12 |
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=50, overlap=30).json()
|
20 |
|
21 |
# Menghitung jumlah objek per kelas
|
22 |
class_count = {}
|