nodejs için Microsoft Cognitive Services api kullanıyorum. Bu kod aşağıdaki olsun hataTypeError: cognitiveServices.face bir kurucu değil
const face = new cognitiveServices.face({
^
TypeError: cognitiveServices.face is not a constructor
at Object.<anonymous> (/Users/..../face.js:3:14)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.runMain (module.js:590:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
nasıl bu hatayı giderebilirsiniz yürütmek zaman, kod ancak
const cognitiveServices = require('cognitive-services');
const face = new cognitiveServices.face({
API_KEY: yourApiKey
})
const parameters = {
returnFaceId: "true"
returnFaceLandmarks: "false"
};
const body = {
"url": "URL of input image"
};
face.detect({
parameters,
body
})
.then((response) => {
console.log('Got response', response);
})
.catch((err) => {
console.error('Encountered error making request:', err);
});
aşağıdaki mı? Bu cognitive-services
modülü belgelerine benziyor
Bir sağ, o modülün üzerinde açıklama gerektiren var? Sorunuzu bu ifadeyi içerecek şekilde düzenleyebilir misiniz? Benzer şekilde, Kurulum ve Başlarken adımlarına göre bilişsel hizmetlerini doğru şekilde yüklediğinizi doğrulamak iyi olur. Https://github.com/joshbalfour/node-cognitive-services#installation. – ArthurDenture
Evet Bunu aldım ve sorumu güncelledim. – 2619
Merhaba, cevabım sizin için mi çalıştı? Ben kelle hala açık olduğunu görüyorum ... – ArthurDenture