Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to detect artifact #3

Open
mapo80 opened this issue Feb 14, 2024 · 5 comments
Open

Need to detect artifact #3

mapo80 opened this issue Feb 14, 2024 · 5 comments

Comments

@mapo80
Copy link

mapo80 commented Feb 14, 2024

Hi,

I found this project very interesting.
I need to detect if an image contains ink artifacts, I don't need to cleaned images.
According to you can I use this model to find all artifacts contained on images?

Thanks

@jponf
Copy link
Collaborator

jponf commented Feb 14, 2024

Hi @mapo80 ,

The model is designed to remove ink artifacts. For detection I would recommend adapting the data generator to generate "heat-maps", similar to what they do in CRAFT: https://arxiv.org/abs/1904.01941, and train a single U-net to generate those heat-maps.

Then, you can compute the polygons that enclose those heat-maps with classical computer vision algorithms. This model should be able to handle any number of artifacts in an image, provided that it has been trained properly.

The paper is quite easy to read and we used this approach for something different in the past and it worked quite well.

@Guillem96 do you have any suggestion?

@mapo80
Copy link
Author

mapo80 commented Feb 14, 2024

Hi @jponf, I don't how to thank you. Thanks very much for all your support. I'll give it a try.
Thanks very much!

@mapo80
Copy link
Author

mapo80 commented Feb 14, 2024

Hi, I want to send some example of artifacts that I need to detect. According to you, could it works?

202402121016348500047

202402121016348500019

202402121016348500022

@jponf
Copy link
Collaborator

jponf commented Feb 15, 2024

Yes, it should work with these samples. I've been trying to find the code that we had to generate the "heat-map" for training, but it's probably long gone from my archives.

The idea is simple though, you keep clean images and artifact images as two inputs to your data generator. Then, simply blend the artifacts with the clean image. To get even more variability, you can apply transformations to the artifacts.

If your artifacts have weird shapes and it's hard to generate the heat-map programmatically you can always create it on an image manipulation program (i.e, GIMP). Then your data generator simply applies the same transformations to the artifact sample and the accompanying heat-map sample to generate the (input, output) pairs.

For more information I suggest looking at the original CRAFT repository: https://github.com/clovaai/CRAFT-pytorch/tree/master

@mapo80
Copy link
Author

mapo80 commented Feb 15, 2024

Ok thanks very much. I'll give it a try!

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants