-
Notifications
You must be signed in to change notification settings - Fork 47
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
Are there requirements for the input image size?(question) #193
Comments
@jasan-s - Great question! Something we should also point to in our documentation. In general, here's what I would say (@yining1023 feel free to correct me if I'm wrong!):
I hope this helps! I will keep this open so that we make sure to add:
Thank you! |
Hi @jasan-s, Good question! From the library source code point of view:
|
@yining1023 @joeyklee agree that it would be great addition to the docs. Since mobile net crops a square 224 px from the center it would be best to enforce the input(i.e live webcam feed) to be a square ratio. Because if the important area of the feature for classification lies outside the square then user adding those examples to model would be meaningless.
Important difference is that what user sees on screen is higher resolution but the same 1:1 square ratio then what is being used for building the model. |
Because we want ml5 to be easy for beginners, we made the decision to handle all of the image cropping and resizing behind the scenes when sending an image to MobileNet. However, we probably should be more clear in the documentation as to what is going on as well as consider consistency with other systems. This came up when working with @irealva on compatibility with the new teachable machine which by default flips the webcam's image! (@yining1023 re: KNN, I believe anytime an image is sent to MobileNet it has to be a 224x224 square image? KNNclassifier can, of course, accept other forms of data, but in terms of the features of an image extracted from MobileNet, the same constraints apply, yes?) |
@shiffman yes! That is correct. |
@shiffman agree that handling image normalizing within lib is good decision. seems to be done here mobilenetInfer function using image.resize_bilinear. @shiffman @yining1023 @joeyklee Can you please confirm if the the below statements are true: Statement: No mater what size and aspect ratio image is inputed to ml5, there is NEVER any image data loss in normalizing and resizing because Result: If above is true then ml5 users don't have to do any image manipulation and can carelessly send any image. |
Transferred issue from ml5-library to ml5-website because the question has been answered and now we need to update the documentation. |
@sproutleaf > Transferred issue from ml5-library to ml5-website because the question has been answered and now we need to update the documentation. Not seeing the answers/response to questions from @jasan-s in #193 (comment) "Can you please confirm if the the below statements are true: Statement: No mater what size and aspect ratio image is inputed to ml5, there is NEVER any image data loss in normalizing and resizing because align_corners is set true? Result: If above is true then ml5 users don't have to do any image manipulation and can carelessly send any image." Am I missing something? I'm also interested in figuring out the optimal size and resolution for our project |
For the mobile net feature extractor and for using the knn classifier are there any input image requirements? i.e can provide any aspect ratio and resolution image to the mobile net and the knn classifier? Or is it required that a 1:1 ratio image is served but no requirement for the resolution size. Or is there a limit to the max resolution as well.
The text was updated successfully, but these errors were encountered: