def download_and_uncompress_tarball(base_url, filename, data_dir):
def _progress(count, block_size, total_size):
stdout.write('\r>> Downloading %s %.1f%%' % (
filename, float(count * block_size) / float(total_size) * 100.0))
stdout.flush()
tarball_url = base_url + filename
filepath = osp.join(data_dir, filename)
if not tf.gfile.Exists( osp.join(download_dir, model_dl) ):
filepath, _ = urllib.request.urlretrieve(tarball_url, filepath, _progress)
print()
statinfo = stat(filepath)
print('Successfully downloaded', filename, statinfo.st_size, 'bytes.')
else:
print('{} tarball already exists -- not downloading'.format(filename))
tarfile.open(filepath, 'r:*').extractall(data_dir)
download_save_and_freeze_mobilenet.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录