<jupyter_start><jupyter_text>You'll need to download pretrained model from [google dirve](https://drive.google.com/open?id=1cQ27LIn-Rig4-Uayzy_gH5-cW-NRGVzY)  1. model converted from chainer<jupyter_code># in this machine the cupy isn't install correctly... 
# so it's a little slow
#trainer.load('/home/mahaviratcingularity/chainer_best_model_converted_to_pytorch_0.7053.pth')
trainer.load('/home/mahaviratcingularity/simple-faster-rcnn-pytorch-lablp/models/fasterrcnn_withlp.pth')
opt.caffe_pretrain=False # this model was trained from caffe-pretrained model



X = numpy.array(_labels)

#print (X[0,1])
i=0
for i in range (X.shape[1]):
    #print (X[0,i])
    print (LABEL_NAMES[X[0,i]])


_bboxes, _labels, _scores = trainer.faster_rcnn.predict(img,visualize=True)
vis_bbox(at.tonumpy(img[0]),
         at.tonumpy(_bboxes[0]),
         at.tonumpy(_labels[0]).reshape(-1),
         at.tonumpy(_scores[0]).reshape(-1))
print ( _labels)
print  (_scores)
print (_bboxes)
# it failed to find the dog, but if you set threshold from 0.7 to 0.6, you'll find it<jupyter_output>[array([ 0, 10, 10, 12, 26, 29, 29, 30, 31, 33, 35, 36], dtype=int32)]
[array([0.95023704, 0.9499536 , 0.92274314, 0.9227969 , 0.96232533,
       0.9769573 , 0.38931707, 0.94966257, 0.9637182 , 0.9325139 ,
       0.36539766, 0.9433534 ], dtype=float32)]
[array([[ 874.90045,  566.86725, 1099.3694 ,  706.8316 ],
       [ 842.2266 ,  484.73816, 1053.898  ,  605.766  ],
       [1081.174  , 1219.2161 , 1296.1874 , 1360.9817 ],
       [1029.2302 , 1061.2607 , 1270.2358 , 1224.0825 ],
       [ 948.4397 ,  814.7312 , 1142.9932 ,  938.14   ],
       [1199.3596 , 1620.3827 , 1429.0635 , 1760.4459 ],
       [1198.3215 , 1703.0204 , 1441.9355 , 1817.0106 ],
       [1008.1824 ,  940.32764, 1189.1702 , 1049.8595 ],
       [1229.773  , 1882.8909 , 1464.6309 , 2041.2297 ],
       [1236.569  , 1735.7858 , 1471.7858 , 1865.8185 ],
       [ 959.94354,  510.98773, 1449.2808 , 2140.598  ],
       [1146.8861 , 1494.2152 , 1379.2623 , 1653.2157 ]], dtype=float32)]<jupyter_text>2. model trained with torchvision pretrained model<jupyter_code>trainer.load('/home/cy/fasterrcnn_12211511_0.701052458187_torchvision_pretrain.pth')
opt.caffe_pretrain=False # this model was trained from torchvision-pretrained model
_bboxes, _labels, _scores = trainer.faster_rcnn.predict(img,visualize=True)
vis_bbox(at.tonumpy(img[0]),
         at.tonumpy(_bboxes[0]),
         at.tonumpy(_labels[0]).reshape(-1),
         at.tonumpy(_scores[0]).reshape(-1))
# it failed to find the dog, but if you set threshold from 0.7 to 0.6, you'll find it<jupyter_output><empty_output><jupyter_text>3. model trained with caffe pretrained model<jupyter_code>trainer.load('/home/cy/fasterrcnn_12222105_0.712649824453_caffe_pretrain.pth')
opt.caffe_pretrain=True # this model was trained from caffe-pretrained model
_bboxes, _labels, _scores = trainer.faster_rcnn.predict(img,visualize=True)
vis_bbox(at.tonumpy(img[0]),
         at.tonumpy(_bboxes[0]),
         at.tonumpy(_labels[0]).reshape(-1),
         at.tonumpy(_scores[0]).reshape(-1))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14829142488716957, 'fraction_numerical': 0.1895551257253385, 'mean_word_length': 3.8943217665615144, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '567634', 'license': 'MIT', 'n_tokens_mistral': 1624, 'n_tokens_neox': 1258, 'n_words': 221, 'path': '.ipynb_checkpoints/demo-checkpoint.ipynb', 'repo_name': 'mahavird/simple-faster-rcnn-pytorch-git', 'size': '3102'}