Skip to content

Commit

Permalink
import visual priors from cloned branch with pad fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sacadena committed Oct 29, 2022
1 parent 2c9e603 commit 0a6582b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
11 changes: 11 additions & 0 deletions ptrnets/zoo/taskonomy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import torch
from torch.hub import load_state_dict_from_url

try:
import visualpriors
except ModuleNotFoundError:
import sys
import subprocess
python = sys.executable
missing = ["git+https://github.com/sacadena/midlevel-reps.git@visualpriors#egg=visualpriors-0.3.5"]
subprocess.check_call([python, '-m', 'pip', 'install', *missing], stdout=subprocess.DEVNULL)


from visualpriors.taskonomy_network import TaskonomyEncoder, LIST_OF_TASKS
from visualpriors.transforms import TASKONOMY_PRETRAINED_URLS

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ torch>=1.4.0
torchvision>=0.5.0
tqdm>=4.42.1
gdown>=4.5.1
visualpriors==0.3.5
git+https://github.com/dicarlolab/CORnet
git+https://github.com/sacadena/midlevel-reps.git@visualpriors#egg=visualpriors-0.3.5
17 changes: 10 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

here = path.abspath(path.dirname(__file__))

requirements = ["torch>=1.4.0",
"torchvision>=0.5.0",
"tqdm>=4.42.1",
"gdown>=4.5.1",
"visualpriors==0.3.5"]
requirements = [
"torch>=1.4.0",
"torchvision>=0.5.0",
"tqdm>=4.42.1",
"gdown>=4.5.1",
]

setup(
name='ptrnets',
Expand All @@ -18,6 +19,8 @@
author_email='santiago.cadena@uni-tuebingen.de',
packages=find_packages(exclude=[]),
install_requires=requirements,
dependency_links=["git+https://github.com/dicarlolab/CORnet@master#egg=CORnet-0.1.0",
"git+https://github.com/sacadena/midlevel-reps.git@visualpriors#egg=visualpriors-0.3.5"]
dependency_links=[
"git+https://github.com/dicarlolab/CORnet@master#egg=CORnet-0.1.0",
"git+https://github.com/sacadena/midlevel-reps.git@visualpriors#egg=visualpriors-0.3.5",
]
)

0 comments on commit 0a6582b

Please sign in to comment.