mirror of
https://github.com/azaion/ai-training.git
synced 2026-04-22 11:36:36 +00:00
add fixes for classes
This commit is contained in:
+15
-1
@@ -158,6 +158,20 @@ def check_labels():
|
|||||||
print('Error!')
|
print('Error!')
|
||||||
|
|
||||||
|
|
||||||
|
def fix_class(folder):
|
||||||
|
for label in os.listdir(folder):
|
||||||
|
if label.startswith('0000'):
|
||||||
|
with open(os.path.join(folder, label), 'r+') as f:
|
||||||
|
lines = f.readlines()
|
||||||
|
for i in range(0, len(lines)):
|
||||||
|
l = lines[i]
|
||||||
|
lines[i] = f'2{l[1:]}'
|
||||||
|
f.seek(0) # rewind
|
||||||
|
f.writelines(lines)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
check_labels()
|
fix_class('datasets/zombobase-2024-06-18/test/labels')
|
||||||
|
fix_class('datasets/zombobase-2024-06-18/train/labels')
|
||||||
|
fix_class('datasets/zombobase-2024-06-18/valid/labels')
|
||||||
# main()
|
# main()
|
||||||
|
|||||||
Reference in New Issue
Block a user