Comments (14)
Hi @lkeab without the background removed, these edges are not noticeable. I don't see the jagged edges even with my inference, atleast they are not noticeable this way I think.
I simply do this to remove the background, so I don't think it is an issue with the background removal process.
from PIL import Image
img = Image.open(src_img_path)
np_img = np.copy(np.asarray(img))
neg_mask = ~mask
np_img[neg_mask] = 255
plt.imshow(np_img)
I wasn't setting VIS_PERIOD if it is not the default. I have set it now and I can confirm that the code is going to dilating
step. Though, I am not sure if the output is any different.. I also tried with 7x7 kernel.. not much improvement.
I see below logs during inference, not sure if they are of any significance
fpn input shapes: {'res2': ShapeSpec(channels=256, height=None, width=None, stride=4), 'res3': ShapeSpec(channels=512, height=None, width=None, stride=8), 'res4': ShapeSpec(channels=1024, height=None, width=None, stride=16), 'res5': ShapeSpec(channels=2048, height=None, width=None, stride=32)}
/home/ubuntu/vangap/transfiner/detectron2/structures/image_list.py:99: UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
max_size = (max_size + (stride - 1)) // stride * stride
/home/ubuntu/miniconda3/envs/transfiner/lib/python3.7/site-packages/torch/functional.py:568: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:2228.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
dilating---------------------------------------
/home/ubuntu/vangap/transfiner/detectron2/modeling/roi_heads/mask_head.py:60: UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
dim_t = temperature ** (2 * (dim_t // 2) / num_pos_feats)
from transfiner.
Hi, have this line triggered during the inference process? You can try to increase the dilation kernel range to reduce the artifacts. This is the result of the woman running on my local machine.
from transfiner.
I did't observe this warning when running my code.
from transfiner.
Could there be an issue with the pytorch/cuda versions?
I am using all the latest versions, and on A100.
from transfiner.
Not sure. I am using the NVIDIA TITAN RTX, Pytorch 1.7.1 and Cuda 11.0.
from transfiner.
If you don't mind, is it possible to provide mask object for one of these images(and details on which model and setttings are used) or provide an option in huggingspaces to download it?
I would like to compare it with what I am seeing and confirm if it's an env issue or something else.
from transfiner.
Hi, I am currently out for a traveling. I think one validation method is to that you report your AP results for our pretrained model (for example r50-fpn-1x) running on your machine. If it is exactly the same, then I think it can exclude the environment factors.
from transfiner.
Hi @lkeab without the background removed, these edges are not noticeable. I don't see the jagged edges even with my inference, atleast they are not noticeable this way I think.
I simply do this to remove the background, so I don't think it is an issue with the background removal process.
from PIL import Image img = Image.open(src_img_path) np_img = np.copy(np.asarray(img)) neg_mask = ~mask np_img[neg_mask] = 255 plt.imshow(np_img)
I wasn't setting VIS_PERIOD if it is not the default. I have set it now and I can confirm that the code is going to
dilating
step. Though, I am not sure if the output is any different.. I also tried with 7x7 kernel.. not much improvement.I see below logs during inference, not sure if they are of any significance
fpn input shapes: {'res2': ShapeSpec(channels=256, height=None, width=None, stride=4), 'res3': ShapeSpec(channels=512, height=None, width=None, stride=8), 'res4': ShapeSpec(channels=1024, height=None, width=None, stride=16), 'res5': ShapeSpec(channels=2048, height=None, width=None, stride=32)} /home/ubuntu/vangap/transfiner/detectron2/structures/image_list.py:99: UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor'). max_size = (max_size + (stride - 1)) // stride * stride /home/ubuntu/miniconda3/envs/transfiner/lib/python3.7/site-packages/torch/functional.py:568: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:2228.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined] dilating--------------------------------------- /home/ubuntu/vangap/transfiner/detectron2/modeling/roi_heads/mask_head.py:60: UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor'). dim_t = temperature ** (2 * (dim_t // 2) / num_pos_feats)
I encountered the same warnings! My env setting: ubuntu 20.04, python 3.7.13, pytorch 1.11.0, cuda 11.3.
from transfiner.
@anl13 Do you also see the jagged edges?
from transfiner.
@vanga Yes, I observed exactly the same results. In fact, I have removed these warnings by replacing a//b
with torch.div(a, b, rounding_mode='floor')
. However, there is no help. See result below. By the way, my GPU for test is Nvidia Titan X.
from transfiner.
@lkeab Can we keep this open until thee is a closure? considering it is not just me?
w.r.t checking AP results, could you please share some pointers on how I can do that?
from transfiner.
Hi, for checking AP results, you can report the inference results on coco val set using our provided pretrained model, such as R50-FPN-1x or 3X. I will also look into this to see whether can help fix it. It's not that noticeable when drawing masks directly on images.
from transfiner.
Hi, we also updated the code. Please try the latest version to see whether it helps or not. These are the results obtained by me.
from transfiner.
Here are my results with updated code. There are improvements compared with previous code. I test three pretrained models for human segmentation.
model: output_3x_transfiner_r101_deform.pth
:
model: output_3x_transfiner_r101.pth
:
model: output_3x_transfiner_r50.pth
:
from transfiner.
Related Issues (20)
- Could you wirte a document about how to fine-tune your pre-trianed weight plz? HOT 4
- Strange visualization result. HOT 1
- how to export trained weights to onnx HOT 1
- Asking for code component HOT 3
- Question about segmentation fault HOT 1
- CUDA out of memory HOT 5
- RuntimeError: torch.nn.functional.binary_cross_entropy and torch.nn.BCELoss are unsafe to autocast HOT 2
- how to generate a polygon label for "polygons in polygons" HOT 1
- Visual error HOT 1
- ImportError: DLL load failed: The specified module cannot be found. HOT 1
- ImportError: cannot import name 'Caffe2Tracer' from 'detectron2.export' HOT 1
- compile fail HOT 1
- if i have a few hundred images to do , will it run on small dataset ? I mean can I train it on small dataset? Thank you for your amazing work HOT 1
- model questions HOT 2
- How to contribute?
- semi-supervised learning HOT 1
- AssertionError: COCOAPI does not support empty polygons HOT 2
- Does the model support exporting onnx?
- What kind of Feature fusion operation does RoI Feature and Coarse Masks do?
- bdd100k support
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 transfiner.