Maintenance updates#69
Open
jangho11 wants to merge 22 commits into
Open
Conversation
Replaced MobileNetV2 with ResNet50V2 and updated preprocessing method.
Refactor prediction result formatting to include top-3 results with probabilities.
Add decoding of model predictions to retrieve top-3 labels.
Resize is now modular, fixed a requirement and image conversion issue as well
Docker compose added for easier start up/teardown commands. Note: seems to be a bit slower than running the build and run commands separately, but allows for an easy, short, one command to build the container.
1/3 in size and slightly better accuracy
Added input validation for image uploads and error handling. Security & Validation (Corrective Maintenance): - Add 16MB file size limit to prevent DoS attacks - Add ALLOWED_EXTENSIONS whitelist for file type validation - Add allowed_file() helper function for extension checking - Add JSON request validation (checks for missing or empty data) - Add image data key validation (checks 'data' key exists) - Add try/except on base64 conversion to handle invalid input - Add None check after image conversion - Add RGB/RGBA color mode validation - Add try/except on model_predict() to prevent server crash - Add 413 error handler for file size exceeded
Added validation for allowed image formats. It was still taking pdf or other exe files as well
Add validation for image data and allowed MIME types.
Removed file type validation for base64 image data. IMG not loaded.
Added validation for base64 image input and error handling for file size and invalid formats.
Refactor response handling for image prediction results to meet input validation purpose
Apache 2.0 License appendix updated Copyright 2019 imfing (original work) Copyright 2026 Noah Rose, Jangho Keum (modifications)
Added a security policy document outlining supported versions and vulnerability reporting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Key changes:
Resize function, Docker Command condensed, security hardening, +EfficientNetB0, +Top-3 predictions