Kaynağa Gözat

Fix relative path for VOC download (#880)

Cleaned up code
5.0
NanoCode012 GitHub 4 yıl önce
ebeveyn
işleme
901243c780
Veri tabanında bu imza için bilinen anahtar bulunamadı GPC Anahtar Kimliği: 4AEE18F83AFDEB23
1 değiştirilmiş dosya ile 11 ekleme ve 30 silme
  1. +11
    -30
      data/scripts/get_voc.sh

+ 11
- 30
data/scripts/get_voc.sh Dosyayı Görüntüle

@@ -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


Yükleniyor…
İptal
Kaydet