Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,8 +4,6 @@ import numpy as np
|
|
4 |
import moviepy.editor as moviepy
|
5 |
|
6 |
st.set_page_config(
|
7 |
-
page_title="Pendeteksi Kendaraan",
|
8 |
-
page_icon="./car.ico",
|
9 |
layout="wide"
|
10 |
)
|
11 |
st.title("PENDETEKSI KENDARAAN")
|
@@ -34,7 +32,6 @@ temp_file_detect = './temp_file_3.mp4'
|
|
34 |
def write_bytesio_to_file(filename, bytesio):
|
35 |
with open(filename, "wb") as outfile:
|
36 |
outfile.write(bytesio.getbuffer())
|
37 |
-
st.balloons()
|
38 |
|
39 |
with st.spinner("Loading..."):
|
40 |
if video_data:
|
@@ -63,7 +60,6 @@ with st.spinner("Loading..."):
|
|
63 |
dilatada = cv2.morphologyEx(dilatada, cv2.MORPH_CLOSE, kernel)
|
64 |
counterShape, h = cv2.findContours(dilatada, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
|
65 |
|
66 |
-
|
67 |
cv2.line(frame1, (25, count_line_position), (1250, count_line_position), (0, 0, 0), 4)
|
68 |
|
69 |
for (i, c) in enumerate(counterShape) :
|
@@ -78,7 +74,6 @@ with st.spinner("Loading..."):
|
|
78 |
detect.append(center)
|
79 |
cv2.circle(frame1, center, 4, (0, 255, 0), -1)
|
80 |
|
81 |
-
|
82 |
for (x, y) in detect :
|
83 |
if y<(count_line_position+offset) and y>(count_line_position-offset) :
|
84 |
counter += 1
|
@@ -100,10 +95,6 @@ with st.spinner("Loading..."):
|
|
100 |
clip1.write_videofile(detectedVideo)
|
101 |
clip = moviepy.VideoFileClip(temp_file_result)
|
102 |
clip.write_videofile(convertedVideo)
|
103 |
-
st.snow()
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
|
108 |
st.success("Berhasil Terdeteksi!", icon="✅")
|
109 |
col1,col2,col3 = st.columns(3)
|
|
|
4 |
import moviepy.editor as moviepy
|
5 |
|
6 |
st.set_page_config(
|
|
|
|
|
7 |
layout="wide"
|
8 |
)
|
9 |
st.title("PENDETEKSI KENDARAAN")
|
|
|
32 |
def write_bytesio_to_file(filename, bytesio):
|
33 |
with open(filename, "wb") as outfile:
|
34 |
outfile.write(bytesio.getbuffer())
|
|
|
35 |
|
36 |
with st.spinner("Loading..."):
|
37 |
if video_data:
|
|
|
60 |
dilatada = cv2.morphologyEx(dilatada, cv2.MORPH_CLOSE, kernel)
|
61 |
counterShape, h = cv2.findContours(dilatada, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
|
62 |
|
|
|
63 |
cv2.line(frame1, (25, count_line_position), (1250, count_line_position), (0, 0, 0), 4)
|
64 |
|
65 |
for (i, c) in enumerate(counterShape) :
|
|
|
74 |
detect.append(center)
|
75 |
cv2.circle(frame1, center, 4, (0, 255, 0), -1)
|
76 |
|
|
|
77 |
for (x, y) in detect :
|
78 |
if y<(count_line_position+offset) and y>(count_line_position-offset) :
|
79 |
counter += 1
|
|
|
95 |
clip1.write_videofile(detectedVideo)
|
96 |
clip = moviepy.VideoFileClip(temp_file_result)
|
97 |
clip.write_videofile(convertedVideo)
|
|
|
|
|
|
|
|
|
98 |
|
99 |
st.success("Berhasil Terdeteksi!", icon="✅")
|
100 |
col1,col2,col3 = st.columns(3)
|