Преглед на файлове

Fix relative path for VOC download (#880)

Cleaned up code
5.0
NanoCode012 GitHub преди 4 години
родител
ревизия
901243c780
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
променени са 1 файла, в които са добавени 11 реда и са изтрити 30 реда
  1. +11
    -30
      data/scripts/get_voc.sh

+ 11
- 30
data/scripts/get_voc.sh Целия файл

@@ -163,48 +163,29 @@ f = open('../tmp/train.txt', 'r')
lines = f.readlines()

for line in lines:
#print(line.split('/')[-1][:-1])
line = "/".join(line.split('/')[2:])
#print(line)
if (os.path.exists("../" + line[:-1])):
os.system("cp ../"+ line[:-1] + " ../VOC/images/train")
line = "/".join(line.split('/')[-5:]).strip()
if (os.path.exists("../" + line)):
os.system("cp ../"+ line + " ../VOC/images/train")
print(os.path.exists('../tmp/train.txt'))
f = open('../tmp/train.txt', 'r')
lines = f.readlines()

for line in lines:
#print(line.split('/')[-1][:-1])
line = "/".join(line.split('/')[2:])
line = line.replace('JPEGImages', 'labels')
line = line.replace('jpg', 'txt')
#print(line)
if (os.path.exists("../" + line[:-1])):
os.system("cp ../"+ line[:-1] + " ../VOC/labels/train")
if (os.path.exists("../" + line)):
os.system("cp ../"+ line + " ../VOC/labels/train")

print(os.path.exists('../tmp/2007_test.txt'))
f = open('../tmp/2007_test.txt', 'r')
lines = f.readlines()

for line in lines:
#print(line.split('/')[-1][:-1])
line = "/".join(line.split('/')[2:])
if (os.path.exists("../" + line[:-1])):
os.system("cp ../"+ line[:-1] + " ../VOC/images/val")

print(os.path.exists('../tmp/2007_test.txt'))
f = open('../tmp/2007_test.txt', 'r')
lines = f.readlines()

for line in lines:
#print(line.split('/')[-1][:-1])
line = "/".join(line.split('/')[2:])
line = "/".join(line.split('/')[-5:]).strip()
if (os.path.exists("../" + line)):
os.system("cp ../"+ line + " ../VOC/images/val")
line = line.replace('JPEGImages', 'labels')
line = line.replace('jpg', 'txt')
#print(line)
if (os.path.exists("../" + line[:-1])):
os.system("cp ../"+ line[:-1] + " ../VOC/labels/val")
if (os.path.exists("../" + line)):
os.system("cp ../"+ line + " ../VOC/labels/val")

END


Loading…
Отказ
Запис