about Faster R-CNN Tensorflow+python 3.5 stay Windows10 Configuration implementation in the environment , You can see here
<https://blog.csdn.net/jcli1_14/article/details/81327047>
. Running in demo.py Only a few pictures are detected for reference , The original code snippet is as follows .
im_names = ['000456.jpg', '000457.jpg', '000542.jpg', '001150.jpg',
'001763.jpg', '004545.jpg'] for im_name in im_names:
print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') print('Demo for
data/demo/{}'.format(im_name)) demo(sess, net, im_name) plt.show()
problem 1: As soon as the test images get more , A dozen of them were displayed on the desktop figure The window looks a little bit exciting , So consider modifying the following code , Conduct batch test and save .


Save path and output format of file under main modification , Because a lot of test pictures are plt.savefig Function save , If no other parameters are set, there will be a lot of blank positions on the image ,plt.savefig Please refer to the official document for the detailed parameter setting of the function :
im_names = os.listdir(cfg.FLAGS2["data_dir"]+'/demo') # Test image location for im_name
in im_names: print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') print('Demo for
data/demo/{}'.format(im_name)) demo(sess, net, im_name) # Save test picture location , And set the output format
plt.savefig(cfg.FLAGS2["data_dir"]+'/test_result/'+ im_name, format =
'png',transparent = True,pad_inches = 0,dpi = 300,bbox_inches = 'tight') #
plt.show()
problem 2: namely demo.py File in each window on the same picture   Show only one type of picture , Instead of showing all categories on each image

This question can refer to the blog :https://blog.csdn.net/10km/article/details/68926498
<https://blog.csdn.net/10km/article/details/68926498>