Skip to content

Instantly share code, notes, and snippets.

@craftoid
Last active June 22, 2020 01:13
Show Gist options
  • Save craftoid/eed46de8f342cfbb6a28fbaa1509045a to your computer and use it in GitHub Desktop.
Save craftoid/eed46de8f342cfbb6a28fbaa1509045a to your computer and use it in GitHub Desktop.
let FormData = require('form-data');
let fs = require('fs');
let form = new FormData();
form.append('image', fs.createReadStream('/tmp/image.jpg'));
form.submit('http://max-image-resolution-enhancer.codait-prod-41208c73af8fca213512856c7a09db52-0000.us-east.containers.appdomain.cloud/model/predict', function(err, res) {
if (err) throw err;
res.pipe(fs.createWriteStream('/tmp/scaled.png'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment