再再一次开始。
- Using conda to install basic modules
conda create -n cv numpy pytorch cudatoolkit=9.0 python=3.7 opencv=3.4.2 -c menpo
conda activate cv
conda install -c pytorch torchvision
- Install gxipy if you use daheng camera.
- Install AutoAim package
pip install .
- Download Dataset
bash scripts/download.sh
- install developing requirements
conda install jupyterlab -c conda-forge
pip install PyQt5
See app/
for more.
from autoaim import *
# load an image
img = helpers.load('../data/test7/img1.jpg')
# make the prediction
predictor = Predictor('weight.csv')
predictor.predict(img, mode='red')
# extract aimmats
aimmat = AimMat(img)
print('find {} contours'.format(len(aimmat.contours)))
pipe(img.copy(),
aimmat.draw_contours,
# aimmat.draw_bounding_rects,
aimmat.draw_rotated_rects,
# aimmat.draw_ellipses,
aimmat.draw_texts()('point_area'),
# aimmat.draw_texts()('greyscale'),
helpers.showoff
)
见/docs/RM2019裁判系统用户接口协议附录 V1.1.pdf
AutoAim从v3开始将区分库维护者和用户,前者主要负责维护autoaim库中的接口和算法实现,后者主要使用autoaim库对各兵种进行调试。
module_name, package_name, ClassName, method_name, ExceptionName, function_name, GLOBAL_VAR_NAME, instance_var_name, function_parameter_name, local_var_name.