Skip to main content

Uses RetinaNet with FastAi

Project description

ObjectDetection

Some experiments with object detection in PyTorch and FastAi. This repo is created for educational reasons and to get a deeper understanding of RetinaNet and object detection general. If you like it, please let me know, if you find any bugs or tips for improvements also.

Install

RetinaNet WSI

The basline for this notebook was created by Sylvain Gugger from FastAi DevNotebook. Thank you very much, it was a great starting point and I'm a big fan off your work.

Library version link
Object-Detection-Metrics https://github.com/rafaelpadilla/Object-Detection-Metrics

Publications using this code:

[x] Deep Learning-Based Quantification of Pulmonary Hemosiderophages in Cytology Slides

Examples:

Results:

Cell detection Coco Chair Coco Couch Coco Vase

Features:

[x] Coco Metric at train time via callback Coco Metrics [x] Flexibility

# use the feature map sizes 32,18,8,4 with 32 channels and two conv layers for detection and classification
RetinaNet(encoder, n_classes=data.train_ds.c, n_anchors=18, sizes=[32,16,8,4], chs=32, final_bias=-4., n_conv=2)
'''
  (classifier): Sequential(
    (0): Sequential(
      (0): Conv2d(32, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
      (1): ReLU()
    )
    (1): Sequential(
      (0): Conv2d(32, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
      (1): ReLU()
    )
    (2): Conv2d(32, 18, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
  )
# use the feature map sizes 32 with 8 channels and three conv layers for detection and classification
RetinaNet(encoder, n_classes=data.train_ds.c, n_anchors=3, sizes=[32], chs=8, final_bias=-4., n_conv=3)

[x] Debug anchor matches for training.

On the left image we see objects that are represented by anchors. On the right objects with no corresponding anchors for training. Anchors The size of the smallest anchors should be further decreased to match the small objects on the right image.

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

object-detection-fastai-0.0.3.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

object_detection_fastai-0.0.3-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

Details for the file object-detection-fastai-0.0.3.tar.gz.

File metadata

  • Download URL: object-detection-fastai-0.0.3.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for object-detection-fastai-0.0.3.tar.gz
Algorithm Hash digest
SHA256 5c29d45b18131ef3a4aa8bd3e72c37015d40d2fc593cf6013a7367dd7da075c6
MD5 d82275b16d20d8449abfd4c0a2719a4a
BLAKE2b-256 b6d791e8acf207bd75fc5ee4af3a9b14ec482f9d74e64e997da75a049cba8ad0

See more details on using hashes here.

Provenance

File details

Details for the file object_detection_fastai-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: object_detection_fastai-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 25.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for object_detection_fastai-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ae0c3aaa50956b837269abdbfe253fe2c9a70c9b43c957d8136156608d3f8d16
MD5 f77e91494cc0faa69b94051e877677a8
BLAKE2b-256 980ffab9cf2a0b1f61ba21061a873dc274690fe6790c5d0c327e3ebb4094f0fe

See more details on using hashes here.

Provenance

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