Skip to main content

Annotated images

Split folders with files (e.g. images) into train, validation and test folders.

Keeps the annotation data (if there are any) together with their images.
Given the input folder in the following format:

input/
        img1.jpg
        img1.xml
        img1.json
        img1.*
        img2.jpg
        img2.xml
        img2.json
        img2.*
        ...
    ...

Gives you this:

output/
    train/
        img1.jpg
        img1.xml
        img1.json
        img1.*
        ...
    val/
        img2.jpg
        img2.xml
        img2.json
        img2.*
        ...
    test/
        whatever.jpg
        whatever.xml
        whatever.json
        whatever.*
        ...
  • Works on any file types.
  • A seed lets you reproduce the splits.

Counting occurrences of tags

This package includes functions to count the occurrences of a tag in JSON and XML files.
They can go through all files in a folder and count the occurrence of each tag on every (annotated) image.

Install

pip install annotated-images

Module

import annotated_images

# To only split into training and validation set, set a tuple to `ratio`, i.e, `(.8, .2)`.
annotated-images.split('input_folder', output="output", seed=1337, ratio=(.8, .1, .1))
import annotated_images

# Returns total count of 'tag' found in all json files in 'path'
annotated-images.findTagsJson('path', 'tag')

# Returns total count of 'tag' found in all xml files in 'path'
annotated-images.findTagsXml('path', 'tag')

Ref

this package is forked from https://github.com/jfilter/split-folders

Metadata

Release files for annotated-images 0.1.4

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

Source distribution (sdist)

Source distribution for annotated-images 0.1.4
File Size Uploaded Provenance Actions
annotated_images-0.1.4.tar.gz 3.5 kB Without provenance Details for annotated_images-0.1.4.tar.gz

Release files / annotated_images-0.1.4.tar.gz

Download URL annotated_images-0.1.4.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a2ab7003e62649936f90643d0b4cd0101777b7579fa74248732a5de503653af9
BLAKE2b-256 checksum
How to use checksums
50d6e04b595a2d16847e66afdcc047bfff42607c34b6010327758aec89c5cc0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

Security for annotated-images 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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