Giter Site home page Giter Site logo

nodejs-sdk's People

Contributors

lidang-git avatar meteorasd555 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodejs-sdk's Issues

没有图像风格迁移接口

// 传入可选字段
options = {"option": "cartoon"}
var fs = require('fs');
var image = fs.readFileSync("assets/example.jpg").toString("base64");
// 调用图像无损放大
client.styleTrans(image, options).then(function(result) {
console.log(JSON.stringify(result));
}).catch(function(err) {
// 如果发生网络错误
console.log(err);
});
官方文档不是说有吗

一直返回3302错误

var Client = new AipSpeechClient(APPID, APIKey, SecretKey);

Client.authTypeReq().then(() => {
let Voice = FS.readFileSync('./16k3.pcm');

let VoiceBuffer = new Buffer(Voice);

Client.recognize(VoiceBuffer, 'pcm', 16000, {lan: 'zh', cuid: APPID}).then((result) => {
    console.log(JSON.stringify(result));
}, (err) => {
    console.log(err);
})

});

一直返回
{"err_msg":"authentication failed.","err_no":3302,"sn":"75241621661514821783"}

尝试修改AipSpeech.js文件的asrImpl方法,在85行增加requestInfo.makeDevOptions(this.devAccessToken);
可以通过验证;

recognize方法中Options的cuid应当填写APPID,否则返回参数错误,这个在文档中没有提。

可长点心吧,赶紧把写错的改了

请检查AipBodyAnalysis.js 文件的 第35 行

const HAND_ANALYSIS_PATH = '/rest/2.0/image-classify/v1/driver_behavior';

请务必修改为:

const HAND_ANALYSIS_PATH = '/rest/2.0/image-classify/v1/hand_analysis';

口头警告一次

baidu-aip-sdk/src/http/httpClientVoiceASR.js: Module crypto does not exist in the Haste module map

error: bundling failed: Error: Unable to resolve module crypto from /Users/schneider/Documents/GitHub/Rock2/node_modules/baidu-aip-sdk/src/http/httpClientVoiceASR.js: Module crypto does not exist in the Haste module map

SamuelMactekiMacBook-Pro:Rock SamuelMac$ react-native info

React Native Environment Info:
System:
OS: macOS 10.14
CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Memory: 1.09 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.13.0 - /usr/local/bin/node
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
IDEs:
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: ^0.58.4 => 0.58.4
npmGlobalPackages:
create-react-native-app: 2.0.2
eslint-plugin-react-native: 1.0.0
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
react-native-update-cli: 0.1.0

AipOcrClient invoice No Permission to access data

Hi,
I meet a problem where I have no permission to access data.
I can get the result from other api like "receipt", but I cannot get access to "invoice".
Below is the code from official website:

const AipOcrClient = require('baidu-aip-sdk').ocr
var fs = require('fs');

const APP_ID = ___
const API_KEY = ___
const SECRET_KEY = ___


const client = new AipOcrClient(APP_ID, API_KEY, SECRET_KEY);


var image = fs.readFileSync("./001.jpg").toString("base64");
client.invoice(image).then(function (result) {
    console.log(JSON.stringify(result));
}).catch(function (err) {
    // 如果发生网络错误
    console.log(err);
});

nodejs sdk “param text not exist”

// 调用短文本相似度
var text1 = "浙富股份";
var text2 = "万事通自考网";
client.simnet(text1,text2).then(function(result) {
console.log(JSON.stringify(result));
console.timeEnd('bdaitest');
}).catch(function(err) {
// 如果发生网络错误
console.log(err);
});

例子运行错误,提示{"log_id":2927191944377059300,"error_code":282133,"error_msg":"param text not exist"}

跨域

我想用在前端 请问有什么办法搞定跨域请求?

failed to find cluster with per and lan.

The documentation mentions the availability of English voices, and female and male persons, but whenever I try to pass anything for the option per other than 0 for language en I get this error:

{ err_detail: 'failed to find cluster with per and lan.',
  err_msg: 'parameter error.',
  err_no: 501,
  err_subcode: 22,
  tts_logid: 393635243 }

Is the only voice available for English is a female voice?

人流量统计-动态版文档有错误

  1. 示例代码里area参数不正确,示例文档代码如下:
// 如果有可选参数
var options = {};
options["case_id"] = "123";
options["case_init"] = "123";
options["show"] = "true";
options["area"] = "100";
  1. 希望示例代码里说明case_id不是单纯的string,而是只能是数字的string。如果有数字以外的字符会抛出错误码282004。该错误码并未在文档中说明。

Speech 接口超时时间太短

默认的 10s 超时对于语音识别接口来说有点短,目前的实现感觉改这个超时不太好改。直接覆盖 require('xxxx').HttpClient.DEFAULT_TIMEOUT= 1e5 不太优雅,又没有通过参数传 timeout 进去的方式。改成 requestInfo.timeout || HttpClient.DEFAULT_TIMEOUT 更好?

HttpClient.DEFAULT_TIMEOUT = 10000;

let options = {
method: requestInfo.method,
url: requestInfo.getPureUrl(),
headers: requestInfo.headers,
encoding: null,
timeout: HttpClient.DEFAULT_TIMEOUT,
body: body
};
return this.req(options);

timeout

timeout没有选项可以填写。只能在源码中修改。能否吧timeout暴露出来,变成一个选项呢?

API Keys

Hello.

Can you tell how can I get the API keys and other configurations ?

I searched in the mentioned website, but didn't find there anywhere.

【失望】demo缺乏

我相信很多的东西手册写的不清不楚的,让别人怎么用,自己看着爽了。

var HttpClient = require("baidu-aip-sdk").HttpClient;
 // 上面干嘛了这个,怎么关联上下面的。总之百度就是想累死人,直接说嘛,让我们直接提交问题,累死人
var client = new AipSpeechClient(APP_ID, API_KEY, SECRET_KEY);

vue调用sdk跨域问题

我在vue工程中安装了baidu-aip-sdk,照着文档里的demo开发时,发现有如图所示的跨域问题,由于调用接口都是sdk封装好的,因此也无法采用proxytable的方式解决跨域,请问有什么办法可以解决呢?
image

【文档错误】nodejs关于自定义模板文字识别的文档有误

var fs = require('fs');

var image = fs.readFileSync("assets/example.jpg").toString("base64");
var templateSign = "Nsdax2424asaAS791823112";

// 调用自定义模板文字识别
client.custom(image, templateSign).then(function(result) {
    console.log(JSON.stringify(result));
}).catch(function(err) {
    // 如果发生网络错误
    console.log(err);
});

其中这里边的

client.custom(image, templateSign)

应该改为

client.custom(image, {templateSign})

天坑
浪费我好几个小时

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.