Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

fix(samples): use pureimage instead of canvas#774

Merged
alexander-fenster merged 1 commit into
masterfrom
no-binary-deps
May 6, 2020
Merged

fix(samples): use pureimage instead of canvas#774
alexander-fenster merged 1 commit into
masterfrom
no-binary-deps

Conversation

@alexander-fenster

Copy link
Copy Markdown
Contributor

The face detection sample in Vision uses canvas module to draw rectangles to highlight faces. One problem here is that canvas has a binary dependency, uses node-gyp, falls back to compilation of the native code, and started failing :)

So... there is this new module called pureimage which is at version 0.2.1 at this time and has just 1250 weekly downloads, and I would've never picked it but... it's written in pure JavaScript, and seems like it does its job! For our simple task of drawing a rectangle over the face, it just works, and with only small code changes (and even better promise interface than canvas).

What do you think?

image
(this is a picture from our samples, after face detection, with a rectangle drawn by pureimage)

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 6, 2020
@codecov

codecov Bot commented May 6, 2020

Copy link
Copy Markdown

Codecov Report

Merging #774 into master will increase coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #774      +/-   ##
==========================================
+ Coverage   97.82%   97.89%   +0.06%     
==========================================
  Files          15       15              
  Lines       13759    13759              
  Branches      592      592              
==========================================
+ Hits        13460    13469       +9     
+ Misses        294      285       -9     
  Partials        5        5              
Impacted Files Coverage Δ
src/v1/image_annotator_client.ts 97.51% <0.00%> (+0.19%) ⬆️
src/v1p1beta1/image_annotator_client.ts 95.52% <0.00%> (+1.84%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 44a8dcc...4ff427d. Read the comment docs.

@JustinBeckwith

Copy link
Copy Markdown
Contributor

This is lovely

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants