Comments (2)
thanks! I have got it. However, I meet another question, the ouput images Rounded-off Saliency Mask looks much better than Generated Saliency Mask , which is the real result of this method?
` for batch_idx, (img_np, img_tor) in enumerate(inf_dataloader, start=1):
img_tor = img_tor.to(device)
pred_masks, _ = model(img_tor)
# Assuming batch_size = 1
img_np = np.squeeze(img_np.numpy(), axis=0)
img_np = img_np.astype(np.uint8)
img_np = cv2.cvtColor(img_np, cv2.COLOR_RGB2BGR)
pred_masks_raw = np.squeeze(pred_masks.cpu().numpy(), axis=(0, 1))
pred_masks_round = np.squeeze(pred_masks.round().cpu().numpy(), axis=(0, 1)
print('Image :', batch_idx)
cv2.imshow('Input Image', img_np)
cv2.imshow('Generated Saliency Mask', pred_masks_raw)
cv2.imshow('Rounded-off Saliency Mask', pred_masks_round)`
from pytorch-pyramid-feature-attention-network-for-saliency-detection.
In the raw saliency mask pixel values are between 0 and 1 (this is the output directly from the model), while in the rounded off saliency mask the pixel values are either 0 or 1. The later one looks better as some of the surrounding noise is removed and the resultant mask is much sharper.
from pytorch-pyramid-feature-attention-network-for-saliency-detection.
Related Issues (20)
- Training set Images HOT 1
- Problem with inference.py HOT 1
- Output images HOT 3
- Question about Image size and ratio HOT 2
- File name of the out put images HOT 4
- Detailed questions HOT 1
- Have you tested the trained model on public dataset? HOT 1
- Implementation different from the paper HOT 1
- Question about RetinaNet FPN implementation HOT 1
- How can I save the mask image of test? HOT 2
- epoch HOT 1
- Round off mask removing relavant areas HOT 2
- TypeError: unsupported operand type(s) for %: 'int' and 'NoneType' HOT 4
- Error connect ECONNREFUSED 127.0.0.1:13246
- a little wrong~
- Hi, I'm getting some problems with the inference code. The mask saliency and predictions generated are all black. I think the error occur with the tensor matrix. Did you have any problems like that? HOT 2
- ValueError: num_samples should be a positive integer value, but got num_samples=0 HOT 1
- Data/DUTS-TE-Mask HOT 2
- train.py 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 pytorch-pyramid-feature-attention-network-for-saliency-detection.