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

Speed up by using jpegStream instead of pngStream #55

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion components/GetSaliency-node.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ exec = require('child_process').exec
writeCanvasTempFile = (canvas, callback) ->
tmpFile = new temporary.File

rs = canvas.pngStream()
rs = canvas.jpegStream
quality: 100
ws = fs.createWriteStream tmpFile.path

rs.once 'error', (error) ->
Expand Down
6 changes: 3 additions & 3 deletions spec/GetSaliency.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@ describe 'GetSaliency component', ->
chai.expect(regions[0].polygon[0].x).to.be.a 'number'
chai.expect(regions[0].polygon[0].y).to.be.a 'number'

expected = [[60, 1], [511, 511]]
expected = [[61, 1], [511, 511]]
chai.expect(bounding_rect).to.be.deep.equal expected
chai.expect(polygon).to.be.an 'array'
chai.expect(polygon.length).to.be.gt 0
chai.expect(radius).to.be.closeTo 350, 2
expected = [285, 255]
chai.expect(center).to.be.deep.equal expected
expected =
x: 60
x: 61
y: 1
width: 451
width: 450
height: 510
chai.expect(bbox).to.be.deep.equal expected
chai.expect(confidence).to.be.lte 0.30
Expand Down