Skip to content

Improve image enhancer reliability - #108

Draft
amirgholipour wants to merge 1 commit into
aws-samples:mainfrom
amirgholipour:agent/image-enhancer-reliability
Draft

Improve image enhancer reliability#108
amirgholipour wants to merge 1 commit into
aws-samples:mainfrom
amirgholipour:agent/image-enhancer-reliability

Conversation

@amirgholipour

Copy link
Copy Markdown

What changed

  • Include the staged shared config package in the image-enhancer container.
  • Reduce the default model-facing maximum image dimension from 4000 to 2048 pixels.
  • Store enhanced JPEG objects with the correct image/jpeg content type.
  • Update the enhancer deployment documentation to match the runtime default.

Why this change is proposed

The container build stages shared configuration alongside the foundation package but did not copy that configuration into the image, which can cause imports to fail at startup. Large model-facing images also increase payload size and latency without improving extraction proportionally, and uploaded JPEG results lacked explicit content metadata.

These changes align container contents with the build process, keep model payloads within a practical size, and make enhanced artifacts self-describing in S3.

Benefits

  • Prevents a packaging-time dependency from becoming a runtime import failure.
  • Reduces memory use, request size, and model latency for large scans.
  • Allows browsers and downstream tools to handle enhanced JPEGs correctly.
  • Keeps the final saved image quality setting independent of model-input resizing.

Validation

  • Built and deployed the enhancer container in an isolated BADGERS deployment.
  • Processed a large PNG and verified a JPEG result was written successfully.
  • Verified the output object reports image/jpeg.
  • Verified the changed Python modules compile.
  • Reviewed the branch against the current upstream main.

Authored by Saeed Kasmani (amirgholipour).

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

Successfully merging this pull request may close these issues.

1 participant