初めに
公開されたばかりの「faster rcnn resnest269」を使ってみた。
環境
Windows10 Pro GPUなし Python 3.8.2
バージョンの確認(pip freeze)
実際にインストールしたのは「mxnet」と「gluoncv」のみ。
gluoncvはベータ版を使用。
pip install mxnet pip install gluoncv --pre
その他は勝手についてくる。
certifi==2020.4.5.1 chardet==3.0.4 cycler==0.10.0 gluoncv==0.8.0b20200426 graphviz==0.8.4 idna==2.6 kiwisolver==1.2.0 matplotlib==3.2.1 mxnet==1.6.0 numpy==1.16.6 Pillow==7.1.2 portalocker==1.7.0 pyparsing==3.0.0a1 python-dateutil==2.8.1 pywin32==227 requests==2.18.4 scipy==1.4.1 six==1.14.0 tqdm==4.45.0 urllib3==1.22
実行ファイル
from gluoncv import model_zoo, data, utils from matplotlib import pyplot as plt img_file = utils.download('https://farm7.staticflickr.com/6185/6107916266_9079c606fa_z.jpg', path='kite.jpg') net = model_zoo.get_model('faster_rcnn_fpn_syncbn_resnest269_coco', pretrained=True) x, img = data.transforms.presets.rcnn.load_test(img_file) class_IDs, scores, bounding_boxs = net(x) ax = utils.viz.plot_bbox(img, bounding_boxs[0], scores[0], class_IDs[0], class_names=net.classes) plt.axis('off') plt.show()
結果