34 lines
858 B
Python
Executable File
34 lines
858 B
Python
Executable File
from pathlib import Path
|
|
import tqdm
|
|
|
|
import LFUtilities
|
|
import LATCHExtractor as lf
|
|
import argparse
|
|
import os
|
|
|
|
|
|
if __name__ == '__main__':
|
|
parser = argparse.ArgumentParser(description='LATCH bulk extraction')
|
|
parser.add_argument('src', type=str, help='text file containing a list of img paths')
|
|
parser.add_argument('dest', type=str, help='LATCH dest file')
|
|
|
|
args = parser.parse_args()
|
|
src = args.src
|
|
dest = args.dest
|
|
|
|
with open(src, 'r') as src_file:
|
|
dataset = []
|
|
|
|
print('Extracting lf...')
|
|
for line in src_file:
|
|
try:
|
|
kp, des = lf.extract(line.strip())
|
|
dataset.append((kp, des))
|
|
except:
|
|
print("cannot process '%s'" % line)
|
|
pass
|
|
|
|
LFUtilities.save(dataset, dest)
|
|
|
|
print('lf extracted.')
|