关于canmv 的例程问题

Viewed 31

问题描述


1:15-LVGL文件夹下的lvgl_demo.py里面/sdcard/res/font/SourceHanSansSC-Normal-Min.ttf这个是阉割版的吧,很多字都不显示,我想问下完整矢量字体哪里能下载
2:现成的LVGL有图像拉伸功能吗?我屏幕是竖屏800-1280,而1920-1080的摄像头高度不够,有没有拉伸功能
3:05-AI-Demo文件夹下的face_recognition.py例程修改为竖屏代码如下。我想问下竖屏显示800-1080情况下rgb888p_size的值应该改为多少?我尝试了几种好像都会影响效果

if __name__=="__main__":
    # 注意:执行人脸识别任务之前,需要先执行人脸注册任务进行人脸身份注册生成feature数据库
    # 添加显示模式,默认hdmi,可选hdmi/lcd/lt9611/st7701/hx8399/nt35516/nt35532/gc9503/aml020t/jd9852/ili9806/virt;其中hdmi默认对应lt9611,lcd默认对应st7701
    display_mode="virt"
    # 显示分辨率,None表示使用当前显示屏默认分辨率;使用virt时可在这里手动设置,例如[800, 480]
    display_size=[800, 1080]
    # k230保持不变,k230d可调整为[640,360]
    rgb888p_size = [800, 1080]
    # 人脸检测模型路径
    face_det_kmodel_path="/sdcard/examples/kmodel/face_detection_320.kmodel"
    # 人脸识别模型路径
    face_reg_kmodel_path="/sdcard/examples/kmodel/face_recognition.kmodel"
    # 其它参数
    anchors_path="/sdcard/examples/utils/prior_data_320.bin"
    database_dir ="/sdcard/examples/utils/db/"
    face_det_input_size=[320,320]
    face_reg_input_size=[112,112]
    confidence_threshold=0.5
    nms_threshold=0.2
    anchor_len=4200
    det_dim=4
    anchors = np.fromfile(anchors_path, dtype=np.float)
    anchors = anchors.reshape((anchor_len,det_dim))
    face_recognition_threshold = 0.75        # 人脸识别阈值

    # 初始化PipeLine,rgb888p_size为传给AI的图像分辨率,display_size为显示分辨率
    pl=PipeLine(rgb888p_size=rgb888p_size,display_mode=display_mode, display_size=display_size)
    # 创建PipeLine,可按需传入sensor_id选择摄像头,例如pl.create(sensor_id=2)
    pl.create(crop_vertical=True)
    display_size=pl.get_display_size()
    fr=FaceRecognition(face_det_kmodel_path,face_reg_kmodel_path,det_input_size=face_det_input_size,reg_input_size=face_reg_input_size,database_dir=database_dir,anchors=anchors,confidence_threshold=confidence_threshold,nms_threshold=nms_threshold,face_recognition_threshold=face_recognition_threshold,rgb888p_size=rgb888p_size,display_size=display_size)
    while True:
        with ScopedTiming("total", 1):
            img=pl.get_frame()                      # 获取当前帧
            det_boxes,recg_res=fr.run(img)          # 推理当前帧
            fr.draw_result(pl,det_boxes,recg_res)   # 绘制推理结果
            pl.show_image()                         # 展示推理效果
            gc.collect()
    fr.face_det.deinit()
    fr.face_reg.deinit()
    pl.destroy()


硬件板卡


V3

软件版本


1.8

1 Answers

可以换一个字体文件,比如阿里的普惠体