Update l2y.py (#16)

Fixed _train_test_split() for correct split of test and train.
This commit is contained in:
Arshadoid 2023-03-29 10:17:02 -04:00 committed by GitHub
parent 20110cbcfa
commit a5a8f92059
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -181,7 +181,7 @@ class Labelme2YOLO(object):
test_size = 0.0
if test_size > 1e-8:
train_idxs, test_idxs = train_test_split(
range(tmp_train_len), test_size=test_size / (1 - val_size))
train_idxs, test_size=test_size / (1 - val_size))
train_json_names = [json_names[train_idx] for train_idx in train_idxs]
val_json_names = [json_names[val_idx] for val_idx in val_idxs]
test_json_names = [json_names[test_idx] for test_idx in test_idxs]