Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dependencies #113

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion data/dataset/jnd_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
from PIL import Image
import numpy as np
import torch
from IPython import embed

try:
from IPython import embed
except ModuleNotFoundError:
embed = lambda: None

class JNDDataset(BaseDataset):
def initialize(self, dataroot, load_size=64):
Expand Down
6 changes: 5 additions & 1 deletion data/dataset/twoafc_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
from PIL import Image
import numpy as np
import torch
# from IPython import embed

try:
from IPython import embed
except ModuleNotFoundError:
embed = lambda: None

class TwoAFCDataset(BaseDataset):
def initialize(self, dataroots, load_size=64):
Expand Down
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r requirements.txt
jupyter
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ scikit-image>=0.13.0
opencv-python>=2.4.11
matplotlib>=1.5.1
tqdm>=4.28.1
jupyter
17 changes: 16 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,22 @@
packages=['lpips'],
package_data={'lpips': ['weights/v0.0/*.pth','weights/v0.1/*.pth']},
include_package_data=True,
install_requires=["torch>=0.4.0", "torchvision>=0.2.1", "numpy>=1.14.3", "scipy>=1.0.1", "tqdm>=4.28.1"],
install_requires=[
"torch>=0.4.0",
"torchvision>=0.2.1",
"numpy>=1.14.3",
"scipy>=1.0.1",
"scikit-image>=0.13.0",
"tqdm>=4.28.1",
],
extras_require = {
"dev": ["jupyter"],
"loadimage": [
"rawpy>=0.17.2",
"opencv-python>=2.4.11",
"matplotlib>=1.5.1",
],
},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: BSD License",
Expand Down
6 changes: 5 additions & 1 deletion test_dataset_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
import lpips
from data import data_loader as dl
import argparse
from IPython import embed

try:
from IPython import embed
except ModuleNotFoundError:
embed = lambda: None

parser = argparse.ArgumentParser()
parser.add_argument('--dataset_mode', type=str, default='2afc', help='[2afc,jnd]')
Expand Down
6 changes: 5 additions & 1 deletion test_network.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import torch
import lpips
from IPython import embed

try:
from IPython import embed
except ModuleNotFoundError:
embed = lambda: None

use_gpu = False # Whether to use GPU
spatial = True # Return a spatial map of perceptual distance.
Expand Down
2 changes: 1 addition & 1 deletion util/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from PIL import Image
import numpy as np
import os
import matplotlib.pyplot as plt
import torch

def load_image(path):
Expand All @@ -16,6 +15,7 @@ def load_image(path):
import cv2
return cv2.imread(path)[:,:,::-1]
else:
import matplotlib.pyplot as plt
img = (255*plt.imread(path)[:,:,:3]).astype('uint8')

return img
Expand Down
6 changes: 5 additions & 1 deletion util/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
from . import html
import matplotlib.pyplot as plt
import math
# from IPython import embed

try:
from IPython import embed
except ModuleNotFoundError:
embed = lambda: None

def zoom_to_res(img,res=256,order=0,axis=0):
# img 3xXxX
Expand Down