zhaobenny / bz-cogs

Interesting cogs for Red Bot
MIT License
23 stars 14 forks source link

Improve image pre-processing #9

Closed hollowstrawberry closed 1 year ago

hollowstrawberry commented 1 year ago

Added a new setting to control the max size in megabytes of images to be downloaded and scanned. It is set to 2 MB by default. This saves on bandwidth, and is more effective than limiting the image resolution after the fact.

Speaking of which, after the image is loaded into memory, if it is larger than a 1024*1024 image it will then be scaled down proportionally (eg. a 2560*1536 gets resized to 1321*793). This is important to make analysis cheaper/faster, and there should be no negative impact as image AIs are often trained at these resolutions to begin with. If anything it should improve image recognition.