使用Object Detection API訓練

2021-09-22 10:28:47 字數 1821 閱讀 9355

running locally中提到準備工作大致有三個:

安裝tensorflow object detection api

資料集object detection pipeline設定檔案

沒啥說的,看官網教程installation

可以按照preparing inputs來準備tfrecord格式的資料集。

當然也可以使用models/research/object_detection/dataset_tools/下的指令碼將常見的資料集建立成tfrecord格式的。其中常用的有create_pascal_tf_record.py,就是將安裝pascal voc組織的資料轉換為tfrecord格式。在使用時,**其中的』aeroplane_』 + 多餘,刪去即可。

將object_detection/samples/configs/對應的config檔案拷貝乙份,然後根據實際情況修改。

num_classes:修改為自己的classes num

將所有path_to_be_configured的地方修改為自己之前設定的路徑(共5處)

batch_size根據情況修改,初始設定可能會導致記憶體不夠用。

train.py和eval.py被移到legacy檔案下了。

python object_detection/legacy/train.py \

--logtostderr \

--pipeline_config_path=

$ \ --train_dir=

$

python object_detection/legacy/eval.py \

--logtostderr \

--checkpoint_dir=

$ \ --eval_dir=

$ \ --pipeline_config_path=

$

如果報關於unicode的錯,將object_detection\utils\object_detection_evaluation.py下的category_name = unicode(category_name, 『utf-8』)修改為category_name = str(category_name)

model_main.py將train和eval結合在一塊,官方推薦使用。

python object_detection/legacy/eval.py \

--logtostderr \

--checkpoint_dir=

$ \ --eval_dir=

$ \ --pipeline_config_path=

$

export input_type=image_tensor

python object_detection/export_inference_graph.py \

--input_type=

$ \ --pipeline_config_path=

$ \ --trained_checkpoint_prefix=

$/`head -n 1 $/checkpoint |

grep -o -e '\".+\"'

|sed s/\"//g`

\ --output_directory=

$

tensorflow object detection api應用

第三十二節,使用谷歌object detection api進行目標檢測、訓練新的模型(使用voc 2012資料集)

使用GraphEdit使用

1 註冊元件。其實乙個filter就是乙個com元件,所以使用之前需要註冊,可以有兩種方法對元件進行註冊。1.直接使用命令。命令列下輸入 regsvr32 hqtlystd.ax 編譯之後你會在工程目錄下的debug中找到hqtlystd.ax,這個就是要用的filter 即可註冊成功。2.vc6....

MySQL使用學習使用 mysql學習使用

1 mysql學習 1 安裝 ubuntu下直接安裝 apt get install mysql server 2 檢查伺服器是否啟動 sudo netstat tap grep mysql,如果啟動成功,出現以下資訊 tcp00localhost.localdomain mysql listen ...

學習使用CSDN markdown使用

建立乙個自定義列表 如何建立乙個註腳 注釋也是必不可少的 katex數學公式 新的甘特圖功能,豐富你的文章 uml 圖表 flowchart流程圖 匯出與匯入 你好!這是你第一次使用markdown編輯器所展示的歡迎頁。如果你想學習如何使用markdown編輯器,可以仔細閱讀這篇文章,了解一下mar...