demosaicnet_torch's People
demosaicnet_torch's Issues
ValueError: too many values to unpack?
Dear mgharbi,
There had one error when run the 'make train_demo'. Following the the log.
Thanks for your help!
BR,
out[idx, 0] = (arr[idx, 1] - arr[idx, 2]) / delta[idx]
[14753] INFO train.py:54 | Model configuration: {'model': 'BayerNetwork'}
[14753] INFO train.py:57 | Loading Caffe weights
[14753] INFO train.py:99 | Using l2 loss
Traceback (most recent call last):
File "bin/train.py", line 190, in
main(args, params)
File "bin/train.py", line 132, in main
valset=val_data, cuda=True)
File "/home//Project/demosaicnet_torch-master/torchlib/trainer.py", line 135, in init
self._set_model()
File "/home//Project/demosaicnet_torch-master/torchlib/trainer.py", line 213, in _set_model
chkpt_name, epoch = self.checkpointer.load_latest()
ValueError: too many values to unpack (expected 2)
Makefile:180: recipe for target 'train_demo' failed
make: *** [train_demo] Error 1
Missing LaplacianFilter in demosaic/loss.py?
Dear mgharbi,
@mgharbi
Missing LaplacianFilter in demosaic/loss.py. Please the torchlib in this repo
Thanks!
error happens in torchlib, when retraining the model
Dear mgharbi,
Some error happens when using 'make train_demo', It seems some wrong using torchlib.
self.vis = visdom.Visdom(port=port, env=env) the env is none,and not init correctly at init .
I already start the visdom server by 'python -m visdom.server'
Thanks!
Traceback (most recent call last):
File "~/anaconda3/lib/python3.6/pdb.py", line 1667, in main
pdb._runscript(mainpyfile)
File "~/anaconda3/lib/python3.6/pdb.py", line 1548, in _runscript
self.run(statement)
File "~/anaconda3/lib/python3.6/bdb.py", line 434, in run
exec(cmd, globals, locals)
File "", line 1, in
File "~/Project/demosaicnet_torch-master/train.py", line 16, in
from torchlib.trainer import Trainer
File "./torchlib/trainer.py", line 14, in
class Trainer(object):
File "./torchlib/trainer.py", line 52, in Trainer
callbacks=[callbacks.LossCallback()], valset=None,
File "./torchlib/callbacks.py", line 28, in init
"loss", opts={"legend": ["train", "val"]}, env=env)
File "./torchlib/viz.py", line 12, in init
super(ScalarVisualizer, self).init(port=port, env=env)
File "./torchlib/viz.py", line 7, in init
self.vis = visdom.Visdom(port=port, env=env)
File "~/anaconda3/lib/python3.6/site-packages/visdom/init.py", line 406, in init
}, endpoint='env/' + env)
TypeError: must be str, not NoneType
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
~/anaconda3/lib/python3.6/site-packages/visdom/init.py(406)init()
}, endpoint='env/' + env)
Moir´e and aliasing Metric?
hi,
Thanks for your amazing work for demosaic.
I write the moire metric just like your Siggraph paper, but it doesn't work for many scenes.
Here is my py code for your reference. Thanks!
img1 = cv2.cvtColor(img1, cv2.COLOR_BGR2LAB)
img2 = cv2.cvtColor(img2, cv2.COLOR_BGR2LAB)
res_img_final = np.zeros(img1.shape)
for i in range(3):
dft1 = cv2.dft(np.float32(img1[:, :, i]), flags=cv2.DFT_COMPLEX_OUTPUT)
dft_shift1 = np.fft.fftshift(dft1)
dft2 = cv2.dft(np.float32(img2[:, :, i]), flags=cv2.DFT_COMPLEX_OUTPUT)
dft_shift2 = np.fft.fftshift(dft2)
eps = 1e-8
magnitude_spectrum1 = np.log(cv2.magnitude(dft_shift1[:, :, 0], dft_shift1[:, :, 1]) + eps)
magnitude_spectrum2 = np.log(cv2.magnitude(dft_shift2[:, :, 0], dft_shift2[:, :, 1]) + eps)
res_img = magnitude_spectrum1 - magnitude_spectrum2
res_img_tmp = np.ones(res_img.shape)
a = res_img[int(0.05 * res_img.shape[0]): int(0.95 * res_img.shape[0]),
int(0.05 * res_img.shape[1]): int(0.95 * res_img.shape[1])]
res_img_tmp[int(0.05 * res_img.shape[0]): int(0.95 * res_img.shape[0]),
int(0.05 * res_img.shape[1]): int(0.95 * res_img.shape[1])] = a
res_img = cv2.GaussianBlur(res_img_tmp, (3, 3), 0)
# ret, thresh_img = cv2.threshold(res_img, thres, thres, cv2.THRESH_BINARY)
res_img_final[:, :, i] = res_img
max_channel = np.max(res_img_final, axis=2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.