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

Ad a own Generator and can handle with WebP and AVIF preview. #1008

Merged
merged 2 commits into from
Nov 5, 2023

Conversation

JanisPlayer
Copy link
Contributor

Title: Improved AI Input Image Generation with GD

Description:

This change enables the generation of custom input images for AI with better quality using GD for supported image formats. This results in improved recognition accuracy.

Configuration Options:

  • To disable this feature, set 'recognize.preview.gd' to 'false' in the configuration.
  • To set the quality of JPEG images generated, use 'recognize.preview.quality' (default is '100').

If the image format is not supported, the standard preview generator is used. Additionally, if the standard preview generator produces a WebP or AVIF image format that the AI cannot process, this image is converted to JPEG using GD.

Considering the known issues with WebP previews, I have created a patch to address these problems and enhance recognition quality:

Please refer to the discussion that led to this Pull Request for more context and insights: #996

The code has been tested on my Nextcloud instance. While I acknowledge that this solution may not be perfect, I couldn't find a better one in a short time. Any suggestions for improvement are highly welcome.

@marcelklehr
Copy link
Member

Hey! I'm sorry for the delay. This looks really good! Just approved CI so let's see what the tests say :)

@marcelklehr
Copy link
Member

Awesome! I refactored it a little but seems to work like a charm. Thank you 💙

@marcelklehr marcelklehr merged commit 326ac25 into nextcloud:main Nov 5, 2023
28 of 30 checks passed
Copy link

github-actions bot commented Nov 9, 2023

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the reviewing process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR reviewing process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants