OliverGrace / TinySSD-Pytorch

AI Experiment Personal Homework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TinySSD-Pytorch

AI Experiment Personal Homework

🔧 依赖以及安装

安装

  1. 把项目克隆到本地

    git clone https://github.com/OliverGrace/TinySSD-Pytorch.git
    cd TinySSD-Pytorch
  2. 安装依赖(Anaconda或pip)

    方式1: Anaconda 配置

    conda create --name tinyssd_pytorch --file requirements_conda.txt

    方式2: pip 配置

    pip install -r requirements_pip.txt
  3. Release下载背景图片数据集并将数据解压放至data文件夹中,最终目录如下

    ├─data
      │  create_train.py
      │  
      ├─background
      │      000012-16347456122a06.jpg
      │	    ...
      │      191313-1519470793f344.jpg
      │      191328-15136820086f91.jpg
      │          
      ├─target
      │      0.jpg
      │      0.png
      │      1.png
      │      2.png
      │      
      └─test
             1.jpg
             2.jpg
    
  4. 运行create_train.py生成训练集

    cd data
    python3 create_train.py
    

    运行完成后目录结构如下

    ├─data
      │  create_train.py
      │  
      ├─background
      │      000012-16347456122a06.jpg
      │	    ...
      │      191313-1519470793f344.jpg
      │      191328-15136820086f91.jpg
      │      
      ├─sysu_train
      │  │  label.csv
      │  │  
      │  └─images
      │          000012-16347456122a06.jpg
      │		...
      │          183201-15420187218258.jpg
      │          
      ├─target
      │      0.jpg
      │      0.png
      │      1.png
      │      2.png
      │      
      └─test
             1.jpg
             2.jpg
    

💪 训练以及测试

训练

  • 在train.py中修改batch_size以及epoch之后运行即可 python train.py

测试

  • 在test.py中修改测试文件路径以及weight路径后运行即可得到测试结果 python test.py

测试结果

1 2

😀 如何在自己的数据上训练

  • background文件夹中包含了背景图片,target文件夹中包含了加入到背景图中的目标图片(即需要检测的目标)。此处可以自行替换为所需检测的目标图片,命名为0.png替换后重新调用create_train.py即可生成自己的训练集

Description

This is an implementation of the following released paper by ULSee Inc.. It is a simplified structure for SSD(Single Shot MultiBox Detector).

@article{DBLP:journals/corr/abs-1802-06488,
author = {Alexander Wong and
Mohammad Javad Shafiee and
Francis Li and
Brendan Chwyl},
title = {Tiny {SSD:} {A} Tiny Single-shot Detection Deep Convolutional Neural
Network for Real-time Embedded Object Detection},
journal = {CoRR},
volume = {abs/1802.06488},
year = {2018},
url = {http://arxiv.org/abs/1802.06488},
archivePrefix = {arXiv},
eprint = {1802.06488},
timestamp = {Thu, 01 Mar 2018 19:20:48 +0100},
biburl = {https://dblp.org/rec/bib/journals/corr/abs-1802-06488},
bibsource = {dblp computer science bibliography, https://dblp.org}
}

About

AI Experiment Personal Homework

License:MIT License


Languages

Language:Python 100.0%