INNER CODE UNIT · Python

save_pickle_cache

unrealcv/synthetic-computer-vision · src/scholarutil.py:83

def save_pickle_cache(cache_file, obj):
    print 'Save obj to cache %s' % cache_file
    with open(cache_file, 'w') as f:
        pickle.dump(obj, f)

read_cache = read_pickle_cache
save_cache = save_pickle_cache

def read_yaml_cache(cache_file):
    print 'Load cache from file %s' % cache_file
    if not os.path.isfile(cache_file):
        return None

    with open(cache_file, 'r') as f:
        return yaml.load(f)

def save_yaml_cache(cache_file, obj):
    print 'Save obj to cache %s' % cache_file

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…