INNER CODE UNIT · Python

read_yaml_cache

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

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
    with open(cache_file, 'w') as f:
        yaml.dump(obj, f)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…