This is a guide on how to install Caffe for Ubuntu 16.04 and above, without GPU support (No CUDA required).
sudo apt-get install libopencv-dev python-opencv
class DoneList: | |
FILE_NAME = 'done_list.txt' | |
def __init__(self): | |
self.done_set = set() | |
# Load file ... | |
try: | |
with open(DoneList.FILE_NAME, "r") as fp: | |
for line in fp: | |
annotation_id = line.strip() |
import glob | |
import os | |
import shutil | |
def rm_rf(path): | |
""" 'rm -rf' in Python """ | |
fp_list = glob.glob(path) | |
for fp in fp_list: | |
if os.path.islink(fp): |
def mkdir_p(path): | |
""" 'mkdir -p' in Python """ | |
try: | |
os.makedirs(path) | |
except OSError as exc: # Python >2.5 | |
if exc.errno == errno.EEXIST and os.path.isdir(path): | |
pass | |
else: | |
raise |
def copy_smart(src, dst, make_parents=True, overwrite=False, dry_run=False): | |
""" Copy from src to dst, with option to make make parent folders and overwrite dst """ | |
if not os.path(dst): | |
if os.path.exists(dst): | |
if not overwrite: | |
return False | |
if make_parents: | |
# Make parent directories as needed | |
local_dir_path = os.path.dirname(dst) |