Comments (7)
I could not reproduce that situation.
Could you tell me the command you executed and the size of the input image?
from waifu2x-chainer.
For CPU:
ucok66@ucok66:~/waifu2x-chainer$ python waifu2x.py -e png -a 3 -m noise_scale -S 2000 -n 2 -t -T 2 -b 20 -l 256 -i /home/ucok66/2019-02-27_Flight-of-Spring_by-David-Revoy.jpg -o /home/ucok66/
2.0x upscaling... 0 1 OK
2.0x upscaling... 0 1 OK
Resizing... OK
Elapsed time: 611.125334 sec
Saved as '/home/ucok66/2019-02-27_Flight-of-Spring_by-David-Revoy.png'
for GPU
ucok66@ucok:~/waifu2x-chainer$ python waifu2x.py -g 0 -e png -a 3 -m noise_scale -S 2000 -n 2 -t -T 2 -b 20 -l 256 -i /home/ucok66/2019-02-27_Flight-of-Spring_by-David-Revoy.jpg -o /home/ucok66/
2.0x upscaling... 0 1 OK
2.0x upscaling... 0 1 OK
Resizing... OK
Elapsed time: 5.569068 sec
Saved as '/home/ucok66/2019-02-27_Flight-of-Spring_by-David-Revoy_(tta2)(noise2_scale3.0x)(upresnet10_rgb).png'
Hmm, I thought only GPU have this problem, but the CPU has this problem too. Initially, I wanted to enlarge my image with the size of 2000px for the smallest side, but both of them only produced 1923px
from waifu2x-chainer.
Maybe adding line from __future__ import division
to the beginning of waifu2x.py will solve this issue.
Could you try it?
from waifu2x-chainer.
hmm.
ucok66@ucok66:~/waifu2x-chainer$ python from __future__ import division waifu2x.py -e png -a 3 -m noise_scale -S 2000 -n 2 -t -T 2 -b 20 -l 256 -i /home/ucok66/2019-02-27_Flight-of-Spring_by-David-Revoy.jpg -o /home/ucok66/
python: can't open file 'from': [Errno 2] No such file or directory
ucok66@ucok66:~/waifu2x-chainer$ python waifu2x.py from __future__ import division -e png -a 3 -m noise_scale -S 2000 -n 2 -t -T 2 -b 20 -l 256 -i /home/ucok66/2019-02-27_Flight-of-Spring_by-David-Revoy.jpg -o /home/ucok66/
usage: waifu2x.py [-h] [--gpu GPU] [--input INPUT] [--output_dir OUTPUT_DIR]
[--extension EXTENSION] [--quality QUALITY]
[--arch {VGG7,0,UpConv7,1,ResNet10,2,UpResNet10,3}]
[--model_dir MODEL_DIR] [--method {noise,scale,noise_scale}]
[--scale_ratio SCALE_RATIO] [--noise_level {0,1,2,3}]
[--color {y,rgb}] [--tta] [--tta_level {2,4,8}]
[--batch_size BATCH_SIZE] [--block_size BLOCK_SIZE]
[--width WIDTH | --height HEIGHT | --shorter_side SHORTER_SIDE | --longer_side LONGER_SIDE]
waifu2x.py: error: unrecognized arguments: from __future__ import division
Which one works?
from waifu2x-chainer.
Oh, sorry. It means to open waifu2x.py
in a text editor and editing like this.
from __future__ import division # Add this line
import argparse
import os
import time
...
from waifu2x-chainer.
from waifu2x-chainer.
In Python 2, the /
operator is integer division if inputs are integers.
So the scale_ratio
will be 2000 / 900 = 2
although it should be 2.22
.
In Python 3 or using from __future__ import division
in Python 2, the /
operator is float division.
If you use float division, scale_ratio
is correctly calculated to be 2.22
.
from waifu2x-chainer.
Related Issues (20)
- [Question] how to build Waifu2x-chainer on Gcloud VM instance correctly?
- [feature request] overwrite for corrupt results, skip for finish results
- [Bug] cannot write file as WebP. Wait, what? HOT 3
- training problems HOT 1
- [feature request] suport cuDNN for faster perfomance HOT 2
- [support request] are possible to support all JPEG formats? HOT 1
- Train a model with 2 imputs. HOT 1
- argument '-e' is not functional
- [Question] Use without gpu HOT 2
- [Question] About reproducing same performance of Upconv7 HOT 3
- RuntimeError: CUDA environment is not correctly set up HOT 1
- Is there any way to increase upscale to more than 2x?
- Convert original Torch7 Models to Chainer or ONNX HOT 2
- training custom model, is this accuracy reasonable?
- AttributeError: 'NoneType' object has no attribute 'image'
- Release to pypi.org
- The upresnet10 model is not exported as a caffe model
- Need cunet model
- Question: Is this pip installable?
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.
from waifu2x-chainer.