Skip to content

Commit 2ac75fb

Browse files
committed
Changed Dataset
1 parent 2c4f123 commit 2ac75fb

File tree

1,390 files changed

+478
-100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,390 files changed

+478
-100
lines changed

README.md

Lines changed: 1 addition & 1 deletion

delete_dataset.py

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,40 @@
11
import os
22

3-
folder_path = "training_dataset/masks/road"
3+
land_path = "training_dataset/masks/land"
4+
road_path = "training_dataset/masks/road"
45
img_path = "training_dataset/images"
56

6-
i = 0
7-
x = 0
8-
y = 0
9-
10-
paths = []
11-
all_files = []
12-
same_files = []
13-
14-
for dir_path, dir_names, file_names in os.walk(folder_path):
15-
if x == 0:
16-
all_files = file_names
17-
for dir_path_img, dir_names_img, file_names_img in os.walk(img_path):
18-
if y == 0:
19-
for files in file_names:
20-
for files_img in file_names_img:
21-
if files_img == files:
22-
i+=1
23-
same_files.append(files)
24-
break
25-
y+=1
26-
x+=1
27-
28-
29-
30-
print(len(same_files))
31-
print(len(all_files))
32-
33-
temp3 = [x for x in all_files if x not in same_files]
34-
35-
print(len(temp3))
36-
37-
for path in temp3:
38-
os.remove(folder_path+"/"+path)
7+
def delete_files(folder_path):
8+
i = 0
9+
x = 0
10+
y = 0
11+
12+
paths = []
13+
all_files = []
14+
same_files = []
15+
16+
for dir_path, dir_names, file_names in os.walk(folder_path):
17+
if x == 0:
18+
all_files = file_names
19+
for dir_path_img, dir_names_img, file_names_img in os.walk(img_path):
20+
if y == 0:
21+
for files in file_names:
22+
for files_img in file_names_img:
23+
if files_img == files:
24+
i+=1
25+
same_files.append(files)
26+
break
27+
y+=1
28+
x+=1
29+
30+
temp3 = [x for x in all_files if x not in same_files]
31+
32+
print("Total Files: ",len(all_files))
33+
print("Same Files",len(same_files))
34+
print("Deleted Files: ",len(temp3))
35+
36+
for path in temp3:
37+
os.remove(folder_path+"/"+path)
38+
39+
delete_files(road_path)
40+
delete_files(land_path)

main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import segmentation_models as sm
88

99
# Used input
10-
input_num = 2
10+
input_num = 1
1111

1212
# Training parameter
1313
test_size = 0.2
@@ -262,7 +262,7 @@ def fill_area(img):
262262

263263
model = create_model()
264264

265-
model_path = os.path.join("model/model.h5")
265+
model_path = os.path.join("model/model_1.h5")
266266
model.load_weights(model_path)
267267

268268
tf.debugging.set_log_device_placement(True)
@@ -280,7 +280,7 @@ def fill_area(img):
280280

281281
# Create Trackbars
282282
cv2.namedWindow("Trackbars")
283-
cv2.createTrackbar("Treshold", "Trackbars", 1, 100, nothing)
283+
cv2.createTrackbar("Treshold", "Trackbars", 10, 100, nothing)
284284
cv2.createTrackbar("Lower Limit", "Trackbars", 25, 179, nothing)
285285
cv2.createTrackbar("Upper Limit", "Trackbars", 87, 179, nothing)
286286
cv2.createTrackbar("Area Tolerance", "Trackbars", 50000, 90000, nothing)
@@ -301,7 +301,7 @@ def fill_area(img):
301301
# Predict mask
302302
pred = model.predict(np.expand_dims(frame, 0))
303303

304-
range_tresh = cv2.getTrackbarPos("Treshold", "Trackbars") / 1000
304+
range_tresh = cv2.getTrackbarPos("Treshold", "Trackbars") / 10000
305305

306306
# Process mask
307307
mask = pred.squeeze()

model/model_1.h5

144 KB
Binary file not shown.

train_model.ipynb

Lines changed: 414 additions & 54 deletions
Large diffs are not rendered by default.
428 KB
392 KB
391 KB
384 KB
378 KB

0 commit comments

Comments
 (0)