边缘设备上的计算机视觉
AI算法与图像处理
共 8409字,需浏览 17分钟
·
2021-04-19 16:48
点击上方“AI算法与图像处理”,选择加"星标"或“置顶”
重磅干货,第一时间送达
-
CPU: RISC-V双核64位,带FPU -
图像识别:QVGA@60fps / VGA@30fps -
芯片功耗< 300mW
-
https://medium.com/swlh/what-is-edge-computing-d27d15f843e
迁移学习注释
准备数据
-
tzutalin / labelImg :https://github.com/tzutalin/labelImg
数据集训练
path-to/data
---anns # store the training annotations
---imgs # relevant images for the training
---anns_val # validation annotations
---imgs_val # validation images
{
"model" : {
"type": "Detector",
"architecture": "MobileNet7_5",
"input_size": [224,224],
"anchors": [0.57273, 0.677385, 1.87446, 2.06253, 3.33843, 5.47434, 7.88282, 3.52778, 9.77052, 9.16828],
"labels": ["Apple", "Banana"],
"coord_scale" : 1.0,
"class_scale" : 1.0,
"object_scale" : 5.0,
"no_object_scale" : 1.0
},
"weights" : {
"full": "",
"backend": "imagenet"
},
"train" : {
"actual_epoch": 50,
"train_image_folder": "data/imgs",
"train_annot_folder": "data/anns",
"train_times": 2,
"valid_image_folder": "data/imgs_val",
"valid_annot_folder": "data/anns_val",
"valid_times": 2,
"valid_metric": "mAP",
"batch_size": 4,
"learning_rate": 1e-4,
"saved_folder": "obj_detector",
"first_trainable_layer": "",
"augumentation": true,
"is_only_detect" : false
},
"converter" : {
"type": ["k210"]
}
}
python3 aXelerate/axelerate/traing.py -c config.json
预测
import sensor,image,lcd
import KPU as kpulcd.init()
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.set_windowing((224, 224))
sensor.set_vflip(1)
sensor.run(1)classes = ["Apple", "Banana"]
task = kpu.load("/sd/name_of_the_model_file.kmodel")
a = kpu.set_outputs(task, 0, 7, 7, 35)anchor = (0.57273, 0.677385, 1.87446, 2.06253, 3.33843, 5.47434, 7.88282, 3.52778, 9.77052, 9.16828)
a = kpu.init_yolo2(task, 0.3, 0.3, 5, anchor) while(True):
img = sensor.snapshot().rotation_corr(z_rotation=90.0)
a = img.pix_to_ai()
code = kpu.run_yolo2(task, img)
if code:
for i in code:
a = img.draw_rectangle(i.rect(),color = (0, 255, 0))
a = img.draw_string(i.x(),i.y(), classes[i.classid()],
color=(255,0,0), scale=3)
a = lcd.display(img)
else:
a = lcd.display(img)a = kpu.deinit(task)
个人微信(如果没有备注不拉群!) 请注明:地区+学校/企业+研究方向+昵称
下载1:何恺明顶会分享
在「AI算法与图像处理」公众号后台回复:何恺明,即可下载。总共有6份PDF,涉及 ResNet、Mask RCNN等经典工作的总结分析
下载2:终身受益的编程指南:Google编程风格指南
在「AI算法与图像处理」公众号后台回复:c++,即可下载。历经十年考验,最权威的编程规范!
下载3 CVPR2021
在「AI算法与图像处理」公众号后台回复:CVPR,即可下载1467篇CVPR 2020论文 和 CVPR 2021 最新论文
点亮 ,告诉大家你也在看
评论