-
Notifications
You must be signed in to change notification settings - Fork 2
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
Focus Peaking filter #55
base: dev
Are you sure you want to change the base?
Conversation
Hi! Thanks a lot for help. Can you please create pull request into |
Also you need to add extra requirements for your filter into |
I forgot about the requirements. Will do! |
Done! |
Hf compliance and {filter_name}_pass columns.
New changes include boolean columns f"{filter_name}_pass" with with recommended threshold ratios so that when I import and use the repository externally, I can just use the "True|False" value in this column to determine whether I should keep or reject an image without getting into details of provided metrics. |
Hey @boomb0om, If these changes aren’t merged by New Year, I’ll have to close the source code of my repository. The only reason it’s open now is to merge the code here so that my company doesn’t have to maintain its own fork. I get that my changes might not be your internal priority right now, but since the goal is to make this repo a big, community-supported project, I think the additions could be useful in the long run. Let me know if there’s anything I should tweak to make merging easier. Cheers! |
Yeah, also it has all the changes from the neighboring PR #65 So if you merge this branch, close #65 Added Grayscale detection filter. It detects if image is grayscale even if it has 3 dimensions and was compressed. Usage:
|
Hey! Nice job you have done here! I like the DFP so much so far. I'm on my way to adding my own feature set to filter for portrait images.
This new filter would detect the presence of face on image, would make sure that there is only one face on image and detect focus on this face.
For face detection I use retinaface from DeepFace. Unfortunately DeepFace doesn't support GPU, but in my experience, the biggest bottleneck is IO for huge images, so I was fine with not using GPU.
Next step is to detect whether the image has face as its main focus. I use focus peaking algorithm for it and it worked best for me. For threshold I noticed that images with ratio above 1500 are in focus. With better optics and aperture sizes this value can reach up to 30000. Blurry images have ratio of 200 - 800.
I also changed tqdm to tqdm.auto so that it has a nicer progress bar in jupyter.
I know my filters are pretty specific, but let me know your input and I can make the code more generic.