{"id":13654086,"url":"https://github.com/TencentCloudBase/image-node-sdk","last_synced_at":"2025-04-23T07:30:28.723Z","repository":{"id":32675208,"uuid":"139211870","full_name":"TencentCloudBase/image-node-sdk","owner":"TencentCloudBase","description":"智能图像服务 node sdk","archived":true,"fork":false,"pushed_at":"2022-04-28T13:51:53.000Z","size":1698,"stargazers_count":100,"open_issues_count":8,"forks_count":25,"subscribers_count":45,"default_branch":"master","last_synced_at":"2025-04-18T14:07:18.416Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://cloud.tencent.com/document/product/864/18708","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TencentCloudBase.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-30T02:07:44.000Z","updated_at":"2025-03-31T13:23:27.000Z","dependencies_parsed_at":"2022-08-07T18:00:33.139Z","dependency_job_id":null,"html_url":"https://github.com/TencentCloudBase/image-node-sdk","commit_stats":null,"previous_names":["tencentyun/image-node-sdk"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentCloudBase%2Fimage-node-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentCloudBase%2Fimage-node-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentCloudBase%2Fimage-node-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentCloudBase%2Fimage-node-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TencentCloudBase","download_url":"https://codeload.github.com/TencentCloudBase/image-node-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250390804,"owners_count":21422784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T02:01:23.212Z","updated_at":"2025-04-23T07:30:28.262Z","avatar_url":"https://github.com/TencentCloudBase.png","language":"JavaScript","funding_links":[],"categories":["官方资源"],"sub_categories":[],"readme":"# 腾讯云 - 智能图像服务\n\n[![NPM Version](https://img.shields.io/npm/v/image-node-sdk.svg?style=flat)](https://www.npmjs.com/package/image-node-sdk)\n[![Travis](https://img.shields.io/travis/TencentCloudBase/image-node-sdk.svg)](https://travis-ci.org/TencentCloudBase/image-node-sdk)\n[![Deps](https://david-dm.org/TencentCloudBase/image-node-sdk.svg)](https://david-dm.org/TencentCloudBase/image-node-sdk)\n\n## 安装\n\n```javascript\nnpm i --save image-node-sdk\n```\n\n## 配置\n\n可以设置以下环境变量，这样就不需要传入 `AppId`, `SecretID` 和 `SecretKey` 了。\n```javascript\nprocess.env.TENCENTCLOUD_APPID\nprocess.env.TENCENTCLOUD_SECRETID\nprocess.env.TENCENTCLOUD_SECRETKEY\n\n// 或\nprocess.env.APPID\nprocess.env.SECRETID\nprocess.env.SECRETKEY\n```\n\n## 使用\n\n以 OCR-身份证识别 为例，一般支持外链 url 或者本地读取图片文件，两种方式。\n\n* 外链 url\n\n```javascript\nconst {\n    ImageClient\n} = require('image-node-sdk');\n\nlet AppId = ''; // 腾讯云 AppId\nlet SecretId = ''; // 腾讯云 SecretId\nlet SecretKey = ''; // 腾讯云 SecretKey\n\nlet idCardImageUrl = 'http://images.cnitblog.com/blog/454646/201306/07090518-029ff26fac014d72a7786937e8319c78.jpg';\nlet imgClient = new ImageClient({ AppId, SecretId, SecretKey });\nimgClient.ocrIdCard({\n    data: {\n        url_list: [idCardImageUrl]\n    }\n}).then((result) =\u003e {\n    console.log(result.body)\n}).catch((e) =\u003e {\n    console.log(e);\n});\n```\n* 读取本地文件\n\n```javascript\nconst fs = require('fs');\nconst path = require('path');\nconst {\n    ImageClient\n} = require('image-node-sdk');\n\nlet AppId = ''; // 腾讯云 AppId\nlet SecretId = ''; // 腾讯云 SecretId\nlet SecretKey = ''; // 腾讯云 SecretKey\n\nlet imgClient = new ImageClient({ AppId, SecretId, SecretKey });\nimgClient.ocrIdCard({\n    formData: {\n        card_type: 0,\n        image: fs.createReadStream(path.join(__dirname, './idcard.jpg'))\n    },\n    headers: {\n        'content-type': 'multipart/form-data'\n    }\n}).then((result) =\u003e {\n    console.log(result.body)\n}).catch((e) =\u003e {\n    console.log(e);\n});\n```\n\n如果想运行，[example/index.js](./example/index.js) 下面的例子，请先在项目根目录新建 config/index.js 文件，并按以下格式写下配置\n\n```javascript\nconst ProxyUrl = ''; // 可填公司代理\nconst AppId = ''; // 腾讯云 AppId\nconst SecretId = ''; // 腾讯云  SecretId\nconst SecretKey = ''; // 腾讯云 SecretKey\nconst IdCard = ''; // 身份证号码，用于人脸核身\nconst Name = ''; // 身份证姓名，用于人脸核身\n\nexports.ProxyUrl = ProxyUrl;\nexports.AppId = AppId;\nexports.SecretId = SecretId;\nexports.SecretKey = SecretKey;\nexports.IdCard = IdCard;\nexports.Name = Name;\n```\n\n然后运行\n\n```javascript\nnpm run example\n```\n\n\n## 支持功能\n* 信息认证\n    - [x] [身份证信息认证](https://cloud.tencent.com/document/product/641/13391) - authIdCard\n\n* 人脸识别\n    - [x] [多脸检索](https://cloud.tencent.com/document/product/641/14349) - faceMultiple\n    - [x] [人脸检测与分析](https://cloud.tencent.com/document/product/641/12415) - faceDetect\n    - [x] [五官定位](https://cloud.tencent.com/document/product/641/12416) - faceShape\n    - [x] [个体信息管理-个体创建](https://cloud.tencent.com/document/product/641/12417#.E4.B8.AA.E4.BD.93.E5.88.9B.E5.BB.BA) - faceNewPerson\n    - [x] [个体信息管理-删除个体](https://cloud.tencent.com/document/product/641/12417#.E5.88.A0.E9.99.A4.E4.B8.AA.E4.BD.93) - faceDelPerson\n    - [x] [个体信息管理-增加人脸](https://cloud.tencent.com/document/product/641/12417#.E5.A2.9E.E5.8A.A0.E4.BA.BA.E8.84.B8) - faceAddFace\n    - [x] [个体信息管理-删除人脸](https://cloud.tencent.com/document/product/641/12417#.E5.88.A0.E9.99.A4.E4.BA.BA.E8.84.B8) - faceDelFace\n    - [x] [个体信息管理-设置信息](https://cloud.tencent.com/document/product/641/12417#.E8.AE.BE.E7.BD.AE.E4.BF.A1.E6.81.AF) - faceSetInfo\n    - [x] [个体信息管理-获取信息](https://cloud.tencent.com/document/product/641/12417#.E8.8E.B7.E5.8F.96.E4.BF.A1.E6.81.AF) - faceGetInfo\n    - [x] [个体信息管理-获取组列表](https://cloud.tencent.com/document/product/641/12417#.E8.8E.B7.E5.8F.96.E7.BB.84.E5.88.97.E8.A1.A8) - faceGetGpIds\n    - [x] [个体信息管理-获取人列表](https://cloud.tencent.com/document/product/641/12417#.E8.8E.B7.E5.8F.96.E4.BA.BA.E5.88.97.E8.A1.A8) - faceGetPersonIds\n    - [x] [个体信息管理-获取人脸列表](https://cloud.tencent.com/document/product/641/12417#.E8.8E.B7.E5.8F.96.E4.BA.BA.E8.84.B8.E5.88.97.E8.A1.A8) - faceGetFaceIds\n    - [x] [个体信息管理-获取人脸信息](https://cloud.tencent.com/document/product/641/12417#.E8.8E.B7.E5.8F.96.E4.BA.BA.E8.84.B8.E4.BF.A1.E6.81.AF) - faceGetFaceInfo\n    - [x] [个体信息管理-新增组信息](https://cloud.tencent.com/document/product/641/12417#person.E6.96.B0.E5.A2.9E.E7.BB.84.E4.BF.A1.E6.81.AF) - faceAddGPIds\n    - [x] [个体信息管理-删除组信息](https://cloud.tencent.com/document/product/641/12417#person.E5.88.A0.E9.99.A4.E7.BB.84.E4.BF.A1.E6.81.AF) - faceDelGPIds\n    - [x] [人脸验证](https://cloud.tencent.com/document/product/641/12418) - faceVerify\n    - [x] [人脸检索](https://cloud.tencent.com/document/product/641/12419) - faceIdentify\n    - [x] [人脸对比](https://cloud.tencent.com/document/product/641/12420) - faceCompare\n\n* 文字识别OCR\n    - [x] [手写体识别](https://cloud.tencent.com/document/product/641/12838) - ocrHandWriting\n    - [x] [身份证识别](https://cloud.tencent.com/document/product/641/12424) - ocrIdCard\n    - [x] [营业执照识别](https://cloud.tencent.com/document/product/641/12425) - ocrBizLicense\n    - [x] [行驶证驾驶证识别](https://cloud.tencent.com/document/product/641/12426) - ocrDrivingLicence\n    - [x] [车牌号识别](https://cloud.tencent.com/document/product/641/12427) - ocrPlate\n    - [x] [通用印刷体识别](https://cloud.tencent.com/document/product/641/12428) - ocrGeneral\n    - [x] [银行卡识别](https://cloud.tencent.com/document/product/641/12429) - ocrBankCard\n    - [x] [名片识别（V2)](https://cloud.tencent.com/document/product/641/13209) - ocrBizCard\n\n* 图片识别\n    - [x] [图片标签](https://cloud.tencent.com/document/product/641/12421) - imgTagDetect\n    - [x] [图片鉴黄](https://cloud.tencent.com/document/product/641/12422) - imgPornDetect\n\n* 人脸核身\n    - [x] [人脸静态活体检测](https://cloud.tencent.com/document/product/641/12558) - faceLiveDetectPic\n    - [x] [唇语活体检测视频身份信息核验](https://cloud.tencent.com/document/product/641/12430) - faceIdCardLiveDetectFour\n    - [x] [活体检测—获取唇语验证码](https://cloud.tencent.com/document/product/641/12431) - faceLiveGetFour\n    - [x] [活体检测视频与用户照片的对比](https://cloud.tencent.com/document/product/641/12432) - faceLiveDetectFour\n    - [x] [用户上传照片身份信息核验](https://cloud.tencent.com/document/product/641/12433) - faceIdCardCompare\n\n* 人脸融合\n    - [x] [人脸融合](https://cloud.tencent.com/document/api/670/31061) - faceFuse\n\n* 注意事项\n人脸核身的相关接口，于2019年起全部需要申请新的[人脸核身-云智慧眼](https://console.cloud.tencent.com/ai/facein/cloud-godident-logic)，这样旧版接口也会同时开通。目前本 `SDK` 依旧是使用旧版的接口，新版接口有待后续更新。\n\n## 更新日志\n[日志](./CHANGELOG.md)\n\n## 声明\n测试用的身份证源于[该文章](https://blog.csdn.net/kaka20080622/article/details/50563069)的实验身份证，如有侵权，请联系作者删除。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTencentCloudBase%2Fimage-node-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTencentCloudBase%2Fimage-node-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTencentCloudBase%2Fimage-node-sdk/lists"}