{"id":15293016,"url":"https://github.com/haormj/baize-api","last_synced_at":"2026-04-29T08:08:57.945Z","repository":{"id":125353888,"uuid":"288298605","full_name":"haormj/baize-api","owner":"haormj","description":"baize项目主要是人工智能相关，会将一些主流模型集成，并提供前端web上传图片进行验证。","archived":false,"fork":false,"pushed_at":"2020-08-17T22:24:15.000Z","size":49,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-08T02:27:27.885Z","etag":null,"topics":["ai","baize","go-micro","pytorch"],"latest_commit_sha":null,"homepage":"https://baize.haormj.xyz","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haormj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-17T22:23:14.000Z","updated_at":"2024-06-19T12:33:22.031Z","dependencies_parsed_at":null,"dependency_job_id":"3d1f9848-4b1a-4bd8-9c2e-eb8652d62d1b","html_url":"https://github.com/haormj/baize-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haormj%2Fbaize-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haormj%2Fbaize-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haormj%2Fbaize-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haormj%2Fbaize-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haormj","download_url":"https://codeload.github.com/haormj/baize-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245273127,"owners_count":20588526,"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":["ai","baize","go-micro","pytorch"],"created_at":"2024-09-30T16:37:43.775Z","updated_at":"2026-04-29T08:08:52.926Z","avatar_url":"https://github.com/haormj.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## baize-api\n白泽是中国古代神话中地位崇高的神兽，祥瑞之象征，是令人逢凶化吉的吉祥之兽。白泽亦能说人话，通万物之情，晓天下万物状貌。《白泽图》曰：羊有一角当顶上，龙也，杀之震死。《三才图会》中白泽是狮子身姿，头有一角，山羊胡子。\n\n### 概述\n\nbaize项目主要是人工智能相关，会将一些主流模型集成，并提供前端web上传图片进行验证。目前分为两个模块，[baize-api](https://github.com/haormj/baize-api)和[baize-web](https://github.com/haormj/baize-web)，目前都已开源\n\n1. baize-api主要负责提供后端接口，集成训练好模型\n    - 模型通过pytorch训练，目前训练代码未开源，后续整理好也会开源\n    - 训练完成通过torchscript转化为libtorch可调用模型\n    - [ccutil](https://github.com/haormj/ccutil)会对调用进行封装，并通过[swig](http://www.swig.org/)提供golang接口\n    - [go-micro](https://github.com/micro/go-micro)暴露微服务\n    - [micro](https://github.com/micro/micro)做http网关\n2. baize-web主要负责展现前端页面，提供用户上传界面\n    - 整体基于[react](https://reactjs.org/)\n    - [ant design pro](https://pro.ant.design/)作为脚手架\n    - [ant design](https://ant.design/)有丰富的react库\n\n### 接口列表\n\n|服务 | 方法 | 描述 |\n|------| ------ | ---- |\n|DogsVsCatsService | [GetUploadParam](#DogsVsCatsService.GetUploadParam)     |   获取上传图片参数，主要是阿里云sts返回值    |\n|DogsVsCatsService | [Classify](#DogsVsCatsService.Classify)     |  进行猫狗分类|\n\n\n### DogsVsCatsService.GetUploadParam\n\n#### 接口概述\n\n- 获取上传图片参数\n- http路径：https://baize.haormj.xyz/DogsVsCatsService/GetUploadParam\n- Content-Type：application/json\n\n#### 请求参数\n\n| 名称             | 类型   | 是否必选 | 示例值                           | 描述                                                                        |\n|------------------|--------|----------|----------------------------------|-----------------------------------------------------------------------------|\n|||||\n\n\n#### 返回数据\n\n| 名称    | 类型   | 示例值 | 描述                                                           |\n|---------|--------|--------|----------------------------------------------------------------|\n|region_id|string|oss-cn-shenzhen|主要用于前端使用sts时需传入，比阿里云region_id多了oss前缀|\n|bucket|string|haormj|阿里云bucket名称|\n|access_key_id|string| STS.NUap4fsGWBkAcibt****                  |访问密钥标识|\n|access_key_secret|string| CSjbdvYU4AAR1yNk4cwiPasHAPendnyEepC8V**** |访问密钥|\n|security_token|string| ********                                  |安全令牌|\n|expiration|string| 2020-08-17T22:16:43Z                      |失效时间|\n\n\n#### 示例\n\n\u003e request\n\n```json\n{\n\n}\n```\n\n\u003e response\n\n```json\n{\n    \"region_id\":\"oss-cn-shenzhen\",\n    \"bucket\":\"haormj\",\n    \"access_key_id\":\"STS.NUap4fsGWBkAcibt****\",\n    \"access_key_secret\":\"CSjbdvYU4AAR1yNk4cwiPasHAPendnyEepC8V****\",\n    \"security_token\":\"****\",\n    \"expiration\":\"2020-08-17T22:16:43Z\",\n    \"object_key\":\"xx/xxx/3be14af2e0d511eab1be00163e10a364\"\n}\n```\n\n#### 错误码\n\n| http_code | code | code_msg | 描述 |\n| --- | ---  | --- | --- |\n|500|||服务器内部错误|\n\n### DogsVsCatsService.Classify\n\n#### 接口概述\n\n- 获取上传图片参数\n- http路径：https://baize.haormj.xyz/DogsVsCatsService/Classify\n- Content-Type：application/json\n\n#### 请求参数\n\n| 名称             | 类型   | 是否必选 | 示例值                           | 描述                                                                        |\n|------------------|--------|----------|----------------------------------|-----------------------------------------------------------------------------|\n|object_key|string|是|xx/xxx/xxx|待分类图片的oss路径|\n\n\n#### 返回数据\n\n| 名称    | 类型   | 示例值 | 描述                                                           |\n|---------|--------|--------|----------------------------------------------------------------|\n|result|string| CAT                                             | 分类结果，比如猫或者狗       |\n|image_url|string|http://haormj.oss-cn-shenzhen.aliyuncs.com/****|分类后图片地址，用于前端展示|\n\n#### 示例\n\n\u003e request\n\n```json\n{\n    \"object_key\":\"xx/xxx/xxx\"\n}\n```\n\n\u003e response\n\n```json\n{\n    \"result\":\"CAT\",\n    \"image_url\":\"http://haormj.oss-cn-shenzhen.aliyuncs.com/****\"\n}\n```\n\n#### 错误码\n\n| http_code | code | code_msg | 描述 |\n| --- | ---  | --- | --- |\n|500|||服务器内部错误|\n|404|||未找到对应资源|\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaormj%2Fbaize-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaormj%2Fbaize-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaormj%2Fbaize-api/lists"}