Code Monkey home page Code Monkey logo

object-detection's Introduction

People-Detection

Tensorflow Object Detection API for People Detection

Use Python 3.6 and Tensorflow 1.7

Source : accoon_dataset 做點小修改

轉換xml跟圖檔成 TFRecord 格式

在此使用labelimg進行圖片標註,將標註完的XML跟JPG分別放在:

raccoon_dataset\annotations

raccoon_dataset\images

運行生成csv

python xml_to_csv.py

在生成TFRecord之前,先修正Label Map保持格式一致

# TO-DO replace this with label map
def class_text_to_int(row_label):
    if row_label == 'male':
        return 1
    if row_label == 'female':
        return 2
    else:
        None

運行生成TFRecord

python generate_tfrecord.py

開始訓練

先建立一個label_map.pbtxt,內容為你的Label Map

item {
  id: 1
  name: 'male'
}

item {
  id: 2
  name: 'female'
}

設定模型參數以及配置文件,打開raccoon_dataset\data\faster_rcnn_inception_v2_coco.config,修正文件位置

這裡使用COCO-pretrained SSD with MobileNet model為預訓練模型

fine_tune_checkpoint: "G:\\DL\\faster_rcnn_resnet101_coco_11_06_2017\\model.ckpt"
...
input_path: "G:\\DL\\test\\raccoon_dataset\\data\\train.record"
...
label_map_path: "G:\\DL\\test\\raccoon_dataset\\label_map.pbtxt"
...
input_path: "G:\\DL\\test\\raccoon_dataset\\data\\eval.record"
...
label_map_path: "G:\\DL\\test\\raccoon_dataset\\label_map.pbtxt"

接下來用TensorFlow Object Detection API開始訓練,使用models\research\object_detection\train.py

python train.py \
--logtostderr \
--pipeline_config_path={你的faster_rcnn_inception_v2_coco.config位置} \
--train_dir={訓練模型導出位置} \

Windows 環境需要注意路徑反斜線

object-detection's People

Contributors

d363n6uy avatar

Watchers

 avatar  avatar

Forkers

github-esme

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.