Skip to main content

detecting

Project description

Detecting

The platform for object detection research was implemented with TensorFlow2 eager execution.

TensorFlow 2.2 Python 3.6

GitHub:https://github.com/Qinbf/Detecting

项目初衷是给大家提供一个即方便使用,同时又易于学习的目标检测工具。Detecting给大家提供多种预训练模型,可以直接下载使用,项目中的所有代码都有详细注释。

我先挖个坑,暂时只实现了FasterRCNN算法,后续会把坑填上,把主流的一些算法都实现。希望大家可以给个Star支持一下,谢谢!

如果有很多人喜欢Detecting这个项目的话,我会出一个免费的视频从头到尾讲解这个目标检测项目是如何做出来的。(一行一行代码讲,会讲到所有细节)


安装

首先确保已经安装Tensorflow2环境,然后再安装detecting模块。

  • 推荐使用pip安装:
pip install detecting
  • 也可以使用源码安装:

先使用 git clone项目:

git clone https://github.com/Qinbf/detecting.git

然后 cd 到detecting文件夹中执行安装命令:

cd detecting
sudo python setup.py install
  • 如果需要训练或评估COCO数据集还需要安装pycocotools模块

快速使用

  • 模型预测

通常来说模型预测只需要几行代码

from detecting.build.fasterrcnn import FasterRCNNModel
# 下载并载入预训练模型
model = FasterRCNNModel(backbone='resnet101', weights='COCO', input_shape=(1024, 1024))
# 预测结果并显示
model.predict_show('test_images/000000018380.jpg')
  • 模型训练

通常来说模型训练也只需要几行代码

from detecting.build.fasterrcnn import FasterRCNNModel
from detecting.datasets.datasets import load_tf_dataset
from detecting.config import cfg
# 与配置文件中的配置合并
cfg.merge_from_file('train.yml')
# 载入数据集tf_dataset
tf_dataset = load_tf_dataset(cfg)
# 载入模型 
model = FasterRCNNModel(cfg)
# 训练模型
model.fit(tf_dataset)
  • 更多使用方法可以查看tutorial中的内容以及源代码

VOC 测试集实测结果

Detection Model Backbone Input resolution mAP
FasterRCNN VGG16 1024x1024 53.97

COCO 验证集实测结果

Detection Model Backbone Input resolution AP AP50 AP75 APS APM APL
FasterRCNN ResNet50 640x640 24.7 39.9 26.0 5.7 26.1 42.6
FasterRCNN ResNet50 1024x1024 27.5 43.8 29.5 10.8 32.6 41.5
FasterRCNN ResNet101 640x640 27.0 41.2 29.2 7.2 28.6 45.0
FasterRCNN ResNet101 1024x1024 32.2 47.4 35.2 12.1 35.7 50.4
FasterRCNN ResNet152 640x640 27.7 41.5 29.9 7.8 29.4 46.8
FasterRCNN ResNet152 1024x1024 32.0 46.7 35.2 11.4 35.3 51.6

Acknowledgment:

tensorflow/models/tree/master/research/object_detection

Viredery/tf-eager-fasterrcnn

matterport/Mask_RCNN

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

detecting-0.16.tar.gz (53.1 kB view hashes)

Uploaded Source

Built Distribution

detecting-0.16-py3-none-any.whl (71.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page