Up detect.py のテスト:"image" モード 作成: 2021-05-04
更新: 2021-05-04


    ~/Tensorflow-YOLOv3/data/images/person.jpg に対して物体検出を行う:


      ~ $ source ./venv/bin/activate (venv) $ cd ~/Tensorflow-YOLOv3 物体検出 (約1分): (venv) $ python detect.py --tiny image 0.5 0.5 ./data/images/person.jpg 2021-05-04 18:05:38.288555: E tensorflow/core/platform/hadoop/hadoop_file_system.cc:132] HadoopFileSystem load error: libhdfs.so: cannot open shared object file: No such file or directory WARNING:tensorflow:From detect.py:20: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead. WARNING:tensorflow:From /home/pi/Tensorflow-YOLOv3/core/yolo_tiny.py:76: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead. WARNING:tensorflow:From /home/pi/Tensorflow-YOLOv3/core/layers.py:25: The name tf.layers.Conv2D is deprecated. Please use tf.compat.v1.layers.Conv2D instead. WARNING:tensorflow:From /home/pi/Tensorflow-YOLOv3/core/layers.py:34: The name tf.layers.BatchNormalization is deprecated. Please use tf.compat.v1.layers.BatchNormalization instead. WARNING:tensorflow:From /home/pi/Tensorflow-YOLOv3/core/layers.py:41: The name tf.layers.MaxPooling2D is deprecated. Please use tf.compat.v1.layers.MaxPooling2D instead. WARNING:tensorflow:From /home/pi/Tensorflow-YOLOv3/core/layers.py:97: The name tf.image.resize_nearest_neighbor is deprecated. Please use tf.compat.v1.image.resize_nearest_neighbor instead. WARNING:tensorflow:From detect.py:22: The name tf.train.Saver is deprecated. Please use tf.compat.v1.train.Saver instead. WARNING:tensorflow:From detect.py:22: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead. WARNING:tensorflow:From detect.py:24: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead. person 97.6% dog 90.6% dog 84.6% sheep 93.7% Image Saved at "./detections/image_output.jpg"

    メッセージの最後にあるように,結果の画像がつぎのファイルに出力される:
      ~/Tensorflow-YOLOv3/detections/image_output.png

    PC から ssh -X 接続していれば,PC のデスクトップにこの画像のウィンドウが開く: