Skip to content

Instantly share code, notes, and snippets.

@etrulls
Created March 1, 2019 13:48
Show Gist options
  • Save etrulls/809395c2a48d90caccfc0b5933e761af to your computer and use it in GitHub Desktop.
Save etrulls/809395c2a48d90caccfc0b5933e761af to your computer and use it in GitHub Desktop.
from glob import glob
import os
import sys
gpu = sys.argv[1]
seqs = sys.argv[2].split(',')
for i, seq in enumerate(seqs):
src = '/cvlabdata1/cvlab/datasets_eduard/colmap'
files = glob(f'{src}/{seq}/dense/images/*.jpg')
print(f'{i+1}/{len(seqs)} Processing: {seq}: {len(files)} images')
outp = f'{src}/{seq}/ptn-8k-eval/'
if not os.path.isdir(outp):
os.makedirs(outp)
for f in files:
os.system(f'CUDA_VISIBLE_DEVICES={gpu} python -W ignore ~/src/pdesc/hardnet-master/code/examples/getDesc.py --model ptn.pth --output {outp} --transform PTN --image {f}')
outp = f'{src}/{seq}/stn-8k-eval/'
if not os.path.isdir(outp):
os.makedirs(outp)
for f in files:
os.system(f'CUDA_VISIBLE_DEVICES={gpu} python -W ignore ~/src/pdesc/hardnet-master/code/examples/getDesc.py --model stn.pth --output {outp} --transform STN --image {f}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment