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

Fix HEIC plate extraction by converting to JPEG before sending to openalpr #264

Merged
merged 1 commit into from
Feb 11, 2021

Conversation

josephfrazier
Copy link
Owner

@josephfrazier josephfrazier commented Feb 11, 2021

This adds about 6 seconds of latency since heic-convert is written in
JS, but it's better than nothing. Maybe I can get sharp working at
some point.

Fixes #263:

Here's a test image share.icloud.com/photos/0-5_Dy6WhkGw_7G-mlzadci-w#New_York

I suspect openalpr doesn't support HEIC, and we might need to convert to JPG on the server before sending to openalpr, see lovell/sharp#2004

If we can't get sharp working, try npmjs.com/package/heic-convert

…nalpr

This adds about 6 seconds of latency since `heic-convert` is written in
JS, but it's better than nothing. Maybe I can get `sharp` working at
some point.

Fixes #263
@josephfrazier josephfrazier marked this pull request as ready for review February 11, 2021 04:20
@josephfrazier josephfrazier temporarily deployed to github-heic-openalpr-6nzkvequb February 11, 2021 04:22 Inactive
@josephfrazier josephfrazier merged commit fc15cc4 into master Feb 11, 2021
@josephfrazier josephfrazier deleted the heic.openalpr branch February 11, 2021 04:22
josephfrazier added a commit that referenced this pull request Feb 11, 2021
This drops the latency from 6 seconds down to 1. However, it requires
libheif and libvips to be installed, so I need to figure out how to do
that on Heroku before this can be merged. On MacOS, this made it work
(see lovell/sharp#2004 (comment)):

```
brew install libheif
brew install libvips
yarn remove sharp && yarn add sharp
```

Fixes #265:

> See #264:
>
> > This adds about 6 seconds of latency since `heic-convert` is written in
> > JS, but it's better than nothing. Maybe I can get `sharp` working at
> > some point.
> > Fixes #263:
> > > Here's a test image [share.icloud.com/photos/0-5_Dy6WhkGw_7G-mlzadci-w#New_York](https://share.icloud.com/photos/0-5_Dy6WhkGw_7G-mlzadci-w#New_York)
> > > I suspect openalpr doesn't support HEIC, and we might need to convert to JPG on the server before sending to openalpr, see [lovell/sharp#2004](lovell/sharp#2004)
> > > If we can't get sharp working, try [npmjs.com/package/heic-convert](https://www.npmjs.com/package/heic-convert)
josephfrazier added a commit that referenced this pull request Feb 17, 2021
josephfrazier added a commit that referenced this pull request Feb 18, 2021
…from josephfrazier/remove.dead.heic.code

* Revert "Disable HEIC to JPEG conversion due to OOM errors, see https://reportedcab.slack.com/archives/C9VNM3DL4/p1613245801038700?thread_ts=1610546281.002400&cid=C9VNM3DL4 (#270)"

  This reverts commit 4fd97e5.

* Revert "Fix HEIC plate extraction by converting to JPEG before sending to openalpr (#264)"

  This reverts commit fc15cc4.
@josephfrazier
Copy link
Owner Author

reverted in #275

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.

License plate extraction doesn't work on HEIC files
1 participant