Comments (3)
Figured this out, the semantic segment outputs a channel for each label. By taking the argmax over all channels, you can find the maximum likelihood label for any specific pixel. Then just map each pixel to the RGB value corresponding to the argmax.
from midlevel-reps.
can you provide any code to solve it, thank you very much. @smorad
from midlevel-reps.
Something similar to this
rgb_map = [[random.random() for j in range(3)] for i in range(100)]
_, argmax = np.max(img, dim=1)
for pixel_i in image:
new_img[pixel_i] = rgb_map[argmax]
from midlevel-reps.
Related Issues (9)
- visualpriors source code HOT 1
- Variable not defined HOT 1
- Semseg networks shouldn't apply tanh before softmax HOT 1
- Colorization features require grayscale inputs HOT 1
- Error while importing environment
- size mismatch for decoder_output.0.weight and decoder_output.0.bias HOT 3
- screen command failed "No screen session found." HOT 2
- Pretrained checkpoint HOT 1
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 midlevel-reps.