"Blob is not defined" fetching local images
See original GitHub issueHi, i testing face-api.js and trying loading a local image for make face similarity and is throw me “Blob is not defined” in my nodeJS application, here the function where i try computing descriptors:
face.env.monkeyPatch({ fetch, Blob });
const threshold = 0.6;
var descriptors = { desc1: null, desc2: null };
function computarDescriptor(aDesc, aUri) {
// ~statics/pics/001_tmp.jpg
face.fetchImage(aUri).then(function(result) {
console.log('fecthImage: ' + result);
descriptors['desc' + aDesc] = face.computeFaceDescriptor(result);
}).catch(err => {
console.log(err);
})
}
node-fetch and blob is installed and monkeyPatched and referenceErros is still there.
Thanks
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
How to fetch and display blob images - Stack Overflow
My approach is to convert images to a blob and save the blob url to indexeddb and then when it's time to display,...
Read more >Quickstart: Azure Blob Storage client library for Python
In this quickstart, you learn how to use the Azure Blob Storage client library for Python to create a container and a blob...
Read more >Image & file options | Docs - TinyMCE
Enable or disable automatic upload of images represented by data URLs or blob URIs. Such images get generated, for example, as a result...
Read more >Blobs / Objects — google-cloud 0.20.0 documentation
Create / interact with Google Cloud Storage blobs. class google.cloud.storage.blob. ... If the property is not set locally, returns None .
Read more >ActiveStorage::Blob - Rails API
You're allowed to update a blob's metadata on a subsequent pass, but you should not update the key or change the uploaded file....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
After i define as global i get
Hi @enecumene, @justadudewhohacks
I had a similar issue a few minutes ago. The only difference is that I was trying to fetch the image from the cloud (cloudinary).
I solved it by using the ‘loadImage’ function from the node ‘canvas’ package i.e
import { loadImage } from ‘canvas’;
const referenceImage = await loadImage(refImageUrl);
It might work for local images. Hope this helps