joshbalfour / node-cognitive-services

Microsoft® Cognitive Services SDK for Node.JS
https://www.microsoft.com/cognitive-services
MIT License
105 stars 45 forks source link

Allow uploading images from a local file #47

Closed codefoster closed 6 years ago

codefoster commented 6 years ago

This is a feature request. There's an alternative Node SDK for Cognitive Services at (github.com/felixriesberg/project-oxford) that has the functionality to provide a local path when calling image analysis in the vision API. See the _postLocal function here. The SDK streams the bytes to the API. This is much easier than making sure your image is available from a public URL as appears to be required by this library so far.

miparnisari commented 6 years ago

Hi @codefoster, what specific API are you talking about? For computer vision, analyze image and recognize handwritten text APIs both allow sending local files. See this test and this test.

codefoster commented 6 years ago

Those are the APIs I'm talking about. Thanks for pointing out those tests. I'd missed them. I think it should be a simpler API though. A call like the one made in the test is not so easy for most. I'll think about this and consider a recommended calling pattern and hopefully submit a PR. Thanks.

miparnisari commented 6 years ago

No worries. I agree that the pattern is not very user friendly, but it works for now.

and hopefully submit a PR.

Please do!