日常2021电赛参赛体会 Part1
Posted QFNU_AtomicDlevel
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了日常2021电赛参赛体会 Part1相关的知识,希望对你有一定的参考价值。
P.S.原本打算做飞行器的题,但是由于在比赛前一周左右队友飞控被学弟烧坏了,所以只能去做F题了。。。。
电赛第一天:11月4日
题目在早上7点公布
经过综合考虑选择了”看似“较为稳妥的F题
比赛规定地图:
随后确定了总体的实现方案:
第一天我给EdgeBoard更新了系统镜像和软核
队友则把两个车的底盘给搭了起来,技术报告也开始撰写(埋下一个伏笔)
第一晚回去睡了个好觉,这也是最后电赛过程中最后一次在晚上睡觉
数字识别最初的方案是,将摄像头获取到的图象纵向进行分割,对每幅分割出的图象分别进行数字的识别,优点是所需的分类网络简单,计算量少,缺点则是精确度不够
后来又决定通过先用矩形检测分割出数字字模后对,框内数字进行识别,精确度较前一种方法有所提升,但需要对图象进行二值化处理,不免损失一些特征,同时光照等环境因素对二值化阈值影响较大,泛用性不强
在确定了经过量化后的Yolov3目标检测模型在Edgeboard上的推理速度与精度都足够的情况下,改用了第三种方案也是最终的方案
数字识别最终方案
随后接近一天时间都在忙于网络的搭建与调试,发现:
1.Edgeboard FZ3A最新版本的系统和内核还是不支持Paddlepaddle2.0,依然只能用静态图目前支持的部分算子来组网
解决:使用paddlepaddle1.8版本,静态图组网
2.生成的模型与权重文件应为”model“和”params“,不支持动态图部署
解决:直接改名即可(
3.部署程序在数据读入时有bug无法更新读入数据
解决:仿照官方demo修改了读入方式
4.图象在训练时使用了太多变换增强,导致一些数字混淆
解决:只用随机亮度变化与对比度变化来扩增数据集
5.Edgeboard上PaddleLite的API与树莓派上的不完全相同
解决:看呗…
部分PaddleLite API on Edgeboard:
NAME
paddlelite - C++ core of Paddle-Lite
CLASSES
pybind11_builtins.pybind11_object(builtins.object)
ActivationType
CxxConfig
CxxModelBuffer
DataLayoutType
FlipParam
ImageFormat
ImagePreprocess
PaddlePredictor
Place
PowerMode
PrecisionType
QuantType
TargetType
Tensor
TransParam
class ActivationType(pybind11_builtins.pybind11_object)
| Members:
|
| kIndentity
|
| kRelu
|
| kRelu6
|
| kPRelu
|
| kLeakyRelu
|
| kSigmoid
|
| kTanh
|
| kSwish
|
| Method resolution order:
| ActivationType
| pybind11_builtins.pybind11_object
| builtins.object
|
| Methods defined here:
|
| __eq__ = (...)
| (self: object, arg0: object) -> bool
|
| __ge__ = (...)
| (self: object, arg0: object) -> bool
|
| __getstate__ = (...)
| (self: object) -> int_
|
| __gt__ = (...)
| (self: object, arg0: object) -> bool
|
| __hash__ = (...)
|
| __init__(...)
| __init__(self: paddlelite.ActivationType, arg0: int) -> None
|
| __int__(...)
| __int__(self: paddlelite.ActivationType) -> int
|
| __le__ = (...)
| (self: object, arg0: object) -> bool
|
| __lt__ = (...)
| (self: object, arg0: object) -> bool
|
| __ne__ = (...)
| (self: object, arg0: object) -> bool
|
| __repr__ = (...)
| (self: handle) -> str
|
| __setstate__ = (...)
| (self: paddlelite.ActivationType, arg0: int) -> None
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __members__
|
| name
| (self: handle) -> str
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| kIndentity = ActivationType.kIndentity
|
|
| kLeakyRelu = ActivationType.kLeakyRelu
|
| kPRelu = ActivationType.kPRelu
|
| kRelu = ActivationType.kRelu
|
| kRelu6 = ActivationType.kRelu6
|
| kSigmoid = ActivationType.kSigmoid
|
| kSwish = ActivationType.kSwish
|
| kTanh = ActivationType.kTanh
|
| ----------------------------------------------------------------------
| Methods inherited from pybind11_builtins.pybind11_object:
|
| __new__(*args, **kwargs) from pybind11_builtins.pybind11_type
| Create and return a new object. See help(type) for accurate signature.
class CxxConfig(pybind11_builtins.pybind11_object)
| Method resolution order:
| CxxConfig
| pybind11_builtins.pybind11_object
| builtins.object
|
| Methods defined here:
|
| __init__(...)
| __init__(self: paddlelite.CxxConfig) -> None
|
| get_passes_internal(...)
| get_passes_internal(self: paddlelite.CxxConfig) -> None
|
| is_model_from_memory(...)
| is_model_from_memory(self: paddlelite.CxxConfig) -> bool
|
| model_file(...)
| model_file(self: paddlelite.CxxConfig) -> str
|
| model_from_memory(...)
| model_from_memory(self: paddlelite.CxxConfig) -> None
|
| param_file(...)
| param_file(self: paddlelite.CxxConfig) -> str
|
| quant_model(...)
| quant_model(self: paddlelite.CxxConfig) -> bool
|
| quant_type(...)
| quant_type(self: paddlelite.CxxConfig) -> paddlelite.QuantType
|
| set_model_buffer(...)
| set_model_buffer(self: paddlelite.CxxConfig, arg0: numpy.ndarray[uint8], arg1: numpy.ndarray[uint8]) -> None
|
| set_model_dir(...)
| set_model_dir(self: paddlelite.CxxConfig, arg0: str) -> None
|
| set_model_file(...)
| set_model_file(self: paddlelite.CxxConfig, arg0: str) -> None
|
| set_param_file(...)
| set_param_file(self: paddlelite.CxxConfig, arg0: str) -> None
|
| set_passes_internal(...)
| set_passes_internal(self: paddlelite.CxxConfig, arg0: List[str]) -> None
|
| set_quant_model(...)
| set_quant_model(self: paddlelite.CxxConfig, arg0: bool) -> None
|
| set_valid_places(...)
| set_valid_places(self: paddlelite.CxxConfig, arg0: tuple) -> None
|
| valid_places(...)
| valid_places(self: paddlelite.CxxConfig) -> List[paddlelite.Place]
|
| ----------------------------------------------------------------------
| Methods inherited from pybind11_builtins.pybind11_object:
|
| __new__(*args, **kwargs) from pybind11_builtins.pybind11_type
| Create and return a new object. See help(type) for accurate signature.
class CxxModelBuffer(pybind11_builtins.pybind11_object)
| Method resolution order:
| CxxModelBuffer
| pybind11_builtins.pybind11_object
| builtins.object
|
| Methods defined here:
|
| __init__(...)
| __init__(*args, **kwargs)
| Overloaded function.
|
| 1. __init__(self: paddlelite.CxxModelBuffer, arg0: str, arg1: int, arg2: str, arg3: int) -> None
|
| 2. __init__(self: paddlelite.CxxModelBuffer) -> None
|
| get_params(...)
| get_params(self: paddlelite.CxxModelBuffer) -> str
|
| get_program(...)
| get_program(self: paddlelite.CxxModelBuffer) -> str
|
| is_empty(...)
| is_empty(self: paddlelite.CxxModelBuffer) -> bool
|
| ----------------------------------------------------------------------
| Methods inherited from pybind11_builtins.pybind11_object:
|
| __new__(*args, **kwargs) from pybind11_builtins.pybind11_type
| Create and return a new object. See help(type) for accurate signature.
class DataLayoutType(pybind11_builtins.pybind11_object)
| Members:
|
| kUnk
|
| kNCHW
|
| kNHWC
|
| kImageDefault
|
| kImageFolder
|
| kImageNW
|
| kAny
|
| Method resolution order:
| DataLayoutType
| pybind11_builtins.pybind11_object
| builtins.object
|
| Methods defined here:
|
| __eq__ = (...)
| (self: object, arg0: object) -> bool
|
| __ge__ = (...)
| (self: object, arg0: object) -> bool
|
| __getstate__ = (...)
| (self: object) -> int_
|
| __gt__ = (...)
| (self: object, arg0: object) -> bool
|
| __hash__ = (...)
| (self: object) -> int_
|
| __init__(...)
| __int__(...)
| __int__(self: paddlelite.DataLayoutType) -> int
|
| __le__ = (...)
| (self: object, arg0: object) -> bool
|
| __lt__ = (...)
| (self: object, arg0: object) -> bool
|
| __ne__ = (...)
| (self: object, arg0: object) -> bool
|
| __repr__ = (...)
| (self: handle) -> str
|
| __setstate__ = (...)
| (self: paddlelite.DataLayoutType, arg0: int) -> None
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __members__
|
| name
| (self: handle) -> str
|
| ----------以上是关于日常2021电赛参赛体会 Part1的主要内容,如果未能解决你的问题,请参考以下文章