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

replace jimp with sharp, support more image format, and better performance #35

Closed
wants to merge 6 commits into from

Conversation

luoye-fe
Copy link
Contributor

Sometimes need to analyze svg or webp file, but jimp not support.

@luoye-fe
Copy link
Contributor Author

Maybe conflict with prev-pr, if so, i will fix them one by one.

@ntedgi
Copy link
Owner

ntedgi commented Mar 27, 2021

Sometimes need to analyze svg or webp file, but jimp not support.

how many channels each pixel of this format as ? is it possible to represent them as simple RGBA ? or you need to make another convert

note : the first layer need at least 3 channels

also keep in mind the playground UI uploader doesn't support these types
so we need to make changes in the angular app and test it

@ntedgi ntedgi assigned ntedgi and luoye-fe and unassigned ntedgi Mar 27, 2021
@ntedgi ntedgi added the enhancement New feature or request label Mar 27, 2021
@luoye-fe
Copy link
Contributor Author

At last, all image will be to raw, then toBuffer, and a buffer of length (width * height * channels), containing 8-bit RGB(A) pixel data

But it does need more test case, I'll add it later, ui I will also take a look

@ntedgi
Copy link
Owner

ntedgi commented Mar 28, 2021

i ran npm run example in your branch and master
it looks like there's is different prediction

master

[ { label: 'sports car, sport car', precision: 87.682247186149 }, { label: 'convertible', precision: 7.831910054231743 }, { label: 'car wheel', precision: 4.485842759619256 } ]

luoye-fe:sharp

[ { label: 'sports car, sport car', precision: 82.06160142748257 }, { label: 'car wheel', precision: 9.929226947224464 }, { label: 'convertible', precision: 8.009171625292971 } ]

can you please check again if the transformation to from jimp to sharp is accurate

also I added and example for all supported format lets test them
Screen Shot 2021-03-28 at 9 47 36

@luoye-fe
Copy link
Contributor Author

ok, I will do more test

@luoye-fe
Copy link
Contributor Author

luoye-fe commented Apr 6, 2021

basic image format test:
image

more image format test:
image

Except for the some heic picture, the test results of other picture formats are all good, This problem has bothered me for some days, Maybe you can help me see it together

test code https://github.com/luoye-fe/node-efficientnet/blob/sharp_test/test.ts

From some efficientnet article, preprocess input action is only center crop and resize to suitable resolution, maybe need other operations?

@ntedgi
Copy link
Owner

ntedgi commented Apr 7, 2021

basic image format test:
image

more image format test:
image

Except for the some heic picture, the test results of other picture formats are all good, This problem has bothered me for some days, Maybe you can help me see it together

test code https://github.com/luoye-fe/node-efficientnet/blob/sharp_test/test.ts

From some efficientnet article, preprocess input action is only center crop and resize to suitable resolution, maybe need other operations?

the haic result look very strange , i took the operation procedure from this repo
https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet

@luoye-fe
Copy link
Contributor Author

merge upstream & reopen.

@luoye-fe luoye-fe closed this Apr 10, 2021
@luoye-fe luoye-fe deleted the sharp branch April 10, 2021 04:16
@luoye-fe luoye-fe restored the sharp branch April 10, 2021 04:17
@luoye-fe luoye-fe deleted the sharp branch April 10, 2021 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update playground ui add all available files format
2 participants