提交修改
This commit is contained in:
parent
d03b0460e5
commit
f0089f6f31
@ -29,8 +29,6 @@ import java.util.List;
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/medical")
|
@RequestMapping("/medical")
|
||||||
|
|||||||
@ -0,0 +1,68 @@
|
|||||||
|
package com.heyu.api.controller.others;
|
||||||
|
|
||||||
|
import com.heyu.api.baidu.handle.others.BFacadeHandle;
|
||||||
|
import com.heyu.api.baidu.request.others.BFacadeRequest;
|
||||||
|
import com.heyu.api.baidu.response.others.BFacadeResp;
|
||||||
|
import com.heyu.api.controller.BaseController;
|
||||||
|
import com.heyu.api.data.annotation.CacheResult;
|
||||||
|
import com.heyu.api.data.annotation.NotIntercept;
|
||||||
|
import com.heyu.api.data.utils.ApiR;
|
||||||
|
import com.heyu.api.data.utils.R;
|
||||||
|
import com.heyu.api.resp.others.FacadeResp;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* https://console.bce.baidu.com/support/?_=1740667714316×tamp=1740669989457#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E5%85%B6%E4%BB%96%E5%9C%BA%E6%99%AFOCR&api=rest%2F2.0%2Focr%2Fv1%2Ffacade&method=post
|
||||||
|
*
|
||||||
|
* 门脸文字识别
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* 接口描述
|
||||||
|
* 针对含有门脸/门头的图片进行专项优化,支持识别门脸/门头上的文字内容。
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/facade")
|
||||||
|
@NotIntercept
|
||||||
|
public class FacadeController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BFacadeHandle bFacadeHandle;
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping("/recognize")
|
||||||
|
@CacheResult
|
||||||
|
public R recognize(BFacadeRequest request) {
|
||||||
|
List<FacadeResp> respList = new ArrayList<>();
|
||||||
|
|
||||||
|
ApiR<BFacadeResp> bR = bFacadeHandle.handle(request);
|
||||||
|
if (bR.isSuccess()) {
|
||||||
|
BFacadeResp bFacadeResp = bR.getData();
|
||||||
|
List<BFacadeResp.WordsResultDTO> wordsResultDTOS = bFacadeResp.getWordsResult();
|
||||||
|
|
||||||
|
for (BFacadeResp.WordsResultDTO wordsResultDTO : wordsResultDTOS) {
|
||||||
|
|
||||||
|
FacadeResp facadeResp = new FacadeResp();
|
||||||
|
facadeResp.setWords(wordsResultDTO.getWords());
|
||||||
|
facadeResp.setBrief(wordsResultDTO.getBrief());
|
||||||
|
facadeResp.setWords(wordsResultDTO.getWords());
|
||||||
|
respList.add(facadeResp);
|
||||||
|
}
|
||||||
|
|
||||||
|
return R.ok().setData(respList);
|
||||||
|
|
||||||
|
}
|
||||||
|
return R.error(bR.getErrorMsg());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,67 @@
|
|||||||
|
package com.heyu.api.controller.others;
|
||||||
|
|
||||||
|
import com.heyu.api.baidu.handle.others.BMeterHandle;
|
||||||
|
import com.heyu.api.baidu.request.others.BMeterRequest;
|
||||||
|
import com.heyu.api.baidu.response.others.BMeterResp;
|
||||||
|
import com.heyu.api.controller.BaseController;
|
||||||
|
import com.heyu.api.data.annotation.CacheResult;
|
||||||
|
import com.heyu.api.data.annotation.NotIntercept;
|
||||||
|
import com.heyu.api.data.utils.ApiR;
|
||||||
|
import com.heyu.api.data.utils.R;
|
||||||
|
import com.heyu.api.resp.others.MeterResp;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* https://console.bce.baidu.com/support/?_=1740667714316×tamp=1740667716472#/api?product=AI&project=%E6%96%87%E5%AD%97%E8%AF%86%E5%88%AB&parent=%E5%85%B6%E4%BB%96%E5%9C%BA%E6%99%AFOCR&api=rest%2F2.0%2Focr%2Fv1%2Fmeter&method=post
|
||||||
|
*
|
||||||
|
* 仪器仪表盘读数识别
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*接口描述
|
||||||
|
* 适用于不同品牌、不同型号的仪器仪表盘读数识别,广泛适用于各类血糖仪、血压仪、燃气表、电表等,可识别表盘上的数字、英文、符号,支持液晶屏、字轮表等表型。
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/meter")
|
||||||
|
@NotIntercept
|
||||||
|
public class MeterController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BMeterHandle bMeterHandle;
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping("/recognize")
|
||||||
|
@CacheResult
|
||||||
|
public R recognize(BMeterRequest request) {
|
||||||
|
|
||||||
|
List<MeterResp> meterResp = new ArrayList<>();
|
||||||
|
|
||||||
|
ApiR<BMeterResp> bR = bMeterHandle.handle(request);
|
||||||
|
if (bR.isSuccess()) {
|
||||||
|
BMeterResp bMeterResp = bR.getData();
|
||||||
|
List<BMeterResp.WordsResultDTO> wordsResult = bMeterResp.getWordsResult();
|
||||||
|
|
||||||
|
for (BMeterResp.WordsResultDTO wordsResultDTO : wordsResult) {
|
||||||
|
|
||||||
|
MeterResp meterResp1 = new MeterResp();
|
||||||
|
meterResp1.setWords(wordsResultDTO.getWords());
|
||||||
|
|
||||||
|
|
||||||
|
meterResp.add(meterResp1);
|
||||||
|
|
||||||
|
}
|
||||||
|
return R.ok().setData(meterResp);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return R.error();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package com.heyu.api.resp.others;
|
||||||
|
|
||||||
|
import com.heyu.api.data.dto.BaseResp;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FacadeResp extends BaseResp {
|
||||||
|
|
||||||
|
private String words; // 识别结果字符串
|
||||||
|
private String brief; //门脸副标题等周边描述
|
||||||
|
private Double score; // 门脸副标题等周边描述
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package com.heyu.api.resp.others;
|
||||||
|
|
||||||
|
import com.heyu.api.data.dto.BaseResp;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class MeterResp extends BaseResp {
|
||||||
|
private String words;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user