-
Notifications
You must be signed in to change notification settings - Fork 138
/
setup.py
72 lines (60 loc) · 2.03 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
"""Install script for setuptools."""
from distutils import cmd
import os
import urllib.request
from setuptools import find_packages
from setuptools import setup
from setuptools.command import install
SIMCLR_DIR = 'simclr'
DATA_UTILS_URL = 'https://raw.githubusercontent.com/google-research/simclr/master/data_util.py'
class DownloadSimCLRAugmentationCommand(cmd.Command):
"""Downloads SimCLR data_utils.py as it's not built into an egg."""
description = __doc__
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
build_cmd = self.get_finalized_command('build')
dist_root = os.path.realpath(build_cmd.build_lib)
output_dir = os.path.join(dist_root, SIMCLR_DIR)
if not os.path.exists(output_dir):
os.makedirs(output_dir)
output_path = os.path.join(output_dir, 'data_util.py')
downloader = urllib.request.URLopener()
downloader.retrieve(DATA_UTILS_URL, output_path)
class InstallCommand(install.install):
def run(self):
self.run_command('simclr_download')
install.install.run(self)
setup(
name='meta_dataset',
version='0.2.0',
description='A benchmark for few-shot classification.',
author='Google LLC',
license='Apache License, Version 2.0',
python_requires='>=2.7, <3.10',
packages=find_packages(),
include_package_data=True,
install_requires=[
'absl-py>=0.7.0',
'etils>=0.4.0',
'gin-config>=0.1.2',
'numpy>=1.13.3',
'scipy>=1.0.0',
'setuptools',
'six>=1.12.0',
# Note that this will install tf 2.0, even though this is a tf 1.0
# project. This is necessary because we rely on augmentation from
# tf-models-official that wasn't added until after tf 2.0 was released.
'tensorflow-gpu',
'sklearn',
'tensorflow_probability<=0.7',
'tf-models-official',
'tensorflow-datasets',
],
cmdclass={
'simclr_download': DownloadSimCLRAugmentationCommand,
'install': InstallCommand,
})