Comments (7)
Hey,
You can feed any image into the network as follows:
- Load the image into an RGB numpy tensor
- Rescale the intensity values to [0, 1]
- Make sure that the channel ordering is RGB and not BGR (opencv standard)
- Reshape and dimshuffle the tensor to [1, 3, H, W] where H and W are the image height (rows) and width (cols), respectively.
- Feed the tensor into the network.
from frrn.
Hi @TobyPDE!
I tried to follow the steps you mentioned here but the predictions only get 2 classes (related with light pink and black colors).
I also printed the outout prediction matrix and, from what I understood, it should paint the segmented image with another colors.
[[[2 2 2 ..., 3 2 3]
[2 2 2 ..., 3 2 3]
[2 2 2 ..., 3 3 3]
...,
[9 9 9 ..., 0 0 0]
[8 9 9 ..., 0 0 0]
[0 0 9 ..., 0 0 0]]]
Edit
I made same changes at the create_color_label_image function on dltools/utility.py and it solved my problem.
With the best regards
from frrn.
@BBarbosa Hi, Can you show me your code here ?
from frrn.
@TobyPDE I have tried it . but it seems not work
from frrn.
Hi @daicoolb!
These are the files I have changed:
- use mypredict.py instead of predict.py
- replace the dltools/utility.py
- replace train.py
- replace dltools/architectures.py
I'm using OpenCV 3.3 because it gave me problems trying to load a video file with OpenCV 2.4.
Download files from here frrn.zip
from frrn.
@BBarbosa Thanks for your changes!
I have used your new scripts to predict my own data. The "predictions[0]" has now 3 dimensions instead of 2. For example:
(1, 800, 1280) vs (800, 1280)
Why is that?
And with the same input images, if using "mypredict.py" I got different results from what "predict.py" did. It seems the "image" you feed to "pred_fn(image)" is not the same "batch[0]" the author feeds to "val_fn(batch[0], batch[1])".
from frrn.
@hans41 you're welcome. I hope it helped in some useful way.
Technically, (1,800,1280) and (800,1280) are equivalent.
With regard to the inputs images, i had problems feeding images to the network with the author's provider implementation. So, I managed to adapt one for my own following what @TobyPDE described here . The outputs may differ from mypredict.py to predict.py once there may be some pre-processing operations skipped.
This in an example of what I got. It works really good even in an different angle from what it was trained for.
from frrn.
Related Issues (20)
- Error running predict_frrn_a.py with the prerequisites mentioned in README HOT 1
- what is the point of chinati library? HOT 1
- Dependency Version Requirements? HOT 1
- input image is black HOT 3
- training batch size HOT 1
- Error Running predict on cityscapes with python 2.7 HOT 2
- The questions about prediction HOT 1
- init model HOT 2
- Chianti TypeError in train.py l264 HOT 2
- Dimensionality reduction before last RU's
- train with smaller image resolution
- Trying to evaluation with non cityscape image HOT 2
- ERROR Cannot create cuDNN spatial log softmax. HOT 1
- Adding in associative memory to the network structure
- Getting from cudnn HOT 1
- Predict on own image
- cuDNN spatial log softmax and Chianti C++ library HOT 3
- predict error: IndexError
- Theano and Lasagne version
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 frrn.