Skip to main content

CCAugmentation

Data preprocessing and augmentation framework that is designed for working with crowd counting datasets. It supports multitude of simple as well as advanced transformations and is based on pipelines which allow a flexible flow of data between loaders, transformations and outputs. Deep learning framework-independent, though works best with PyTorch.

Current capabilities

Each data preprocessing procedure is defined in form of a pipeline that consists of a data loader and a list of operations to sequentially execute on the data. Each of the operations may be of the following types:

  • Transformation - Returns transformed data on output, does not have side effects
  • Output - Returns unmodified data on output, has side effects that, for example, write data to files
  • Operation - Performs any other functions, not qualifying for any of the aforementioned types

Available transformations are:

  • Crop
  • Scale
  • Downscale
  • Rotate
  • StandardizeSize
  • Normalize
  • NormalizeDensityMap
  • FlipLR
  • ToGrayscale
  • LambdaTransformation
  • Cutout

Available outputs are:

  • Demonstrate
  • SaveImagesToFiles
  • SaveImagesToBinaryFile
  • SaveDensityMapsToCSVFiles
  • SaveDensityMapsToBinaryFile

Available operations are:

  • Duplicate
  • Dropout
  • RandomArgs
  • OptimizeBatch

Available loaders are:

  • BasicImageFileLoader
  • ImageFileLoader
  • BasicGTPointsMatFileLoader
  • GTPointsMatFileLoader
  • BasicDensityMapCSVFileLoader
  • DensityMapCSVFileLoader
  • VariableLoader
  • ConcatenatingLoader
  • CombinedLoader

For more information about the specific topics, please refer to the related comments in the code.

How to use

Loading the data from ShanghaiTech dataset and taking crops with 1/4 size:

import CCAugmentation as cca
import CCAugmentation as ccat


train_data_pipeline = cca.Pipeline(
    cca.examples.loading.SHHLoader("/data/ShanghaiTech/", "train", "B"),
    [
        ccat.Crop(None, None, 1/4, 1/4)
    ]
)

train_img, train_dm = train_data_pipeline.execute_collect()
# you can also use execute_generate() to create a generator

print(len(train_img), len(train_dm))

To see more examples of usage, please see our experiment environment repository.

Metadata

Release files for ccaugmentation 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ccaugmentation 0.1.0
File Size Uploaded
ccaugmentation-0.1.0.tar.gz 21.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ccaugmentation 0.1.0
File Interpreter ABI Platform
ccaugmentation-0.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 47.2 kB

Release files / ccaugmentation-0.1.0.tar.gz

Download URL ccaugmentation-0.1.0.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
21b7216cd0163106fff2f8830c81957c1cc90e9d2b43789afc8dee232d80c59d
BLAKE2b-256 checksum
How to use checksums
868afde8d766450dae605a8fb8d98b61f7cd4dae2b7051be09b788a95236222e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.3

Release files / ccaugmentation-0.1.0-py2.py3-none-any.whl

Download URL ccaugmentation-0.1.0-py2.py3-none-any.whl
Size 25.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
83bcda4455d3dffdb805d0eb891c4b41f349aa02d7acc48441a247a615af8185
BLAKE2b-256 checksum
How to use checksums
2bc884ee56cb4327c3434fb71eaca9c34d3ae7f0ceb1866ad66730d4e3477dfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page