Skip to content

自信的下载代码,然后手足无措的提出问题 #2

@jin0424

Description

@jin0424

我是Springboot项目,只想用人脸识别,看你的意思,你已经上传到了maven仓库中,我们直接去pom.xml去中央maven仓库拉即可
引入了自己Springboot项目以后就看不懂了。
为什么有好多模型???那我用人脸识别,用哪个pt文件模型?有四个模型文件。

导入模型后,然后是在代码里面直接像你demo写的

-- 引入模型
public FaceAttributeModel getFaceAttributeModel() {
        FaceAttributeConfig config = new FaceAttributeConfig();
        config.setModelEnum(FaceAttributeModelEnum.SEETA_FACE6_MODEL);
        //需替换为实际模型存储路径
        config.setModelPath("C:/Users/Administrator/Downloads/sf3.0_models/sf3.0_models");
        return FaceAttributeModelFactory.getInstance().getModel(config);
    }

-- 业务逻辑
try (FaceAttributeModel faceAttributeModel = getFaceAttributeModel()){
            FaceAttribute faceAttribute = faceAttributeModel.detectTopFace("src/main/resources/iu_1.jpg");
            log.info("人脸属性检测结果:{}", JSONObject.toJSONString(faceAttribute));
        } catch (Exception e) {
            e.printStackTrace();
        }

这样就可以了是吧?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions