Skip to main content

TFlash

A quick way to practice object detection on images and videos for common classes using TensorFlow. Fully operational by any user without Machine Learning experience.

Requirements

imageio
imageio-ffmpeg (for videos)
tensorflow
tqdm

Installation

pip install tflash

Note: due to the incompatibility of numpy versions, in some cases tensorflow needs to be (re-)installed after installing imageio

Usage

import tflash

flash = tflash.Detector()
result = flash.detect("a_pic.jpg", print_output="a_result.jpg") # can be set to False
result = flash.detect("mypic.jpg", min_score=0.75) # default: 0.5

my_pics = ["pic001.jpg", "pic002.jpg", "pic004.jpg"]
result = flash.detect_multiple(my_pics)

Output:

  • Dict of detection results
  • Labeled image(s)

detections = result["detections"] # formatted as dict
print("Saved to {}".format(result["output"]) # output filename

Font

Alter font (default is Roboto size 20):
flash.set_font("arial.ttf")
flash.set_font_size(12)
flash.set_font("dosis.ttf", size=15)

Own Model File

Some good ones are provided at Tensorflow model zoo: https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf1_detection_zoo.md

Download a file with output "Boxes" from the link above, extract and use only the one with *.pb extension, e.g., frozen_inference_graph.pb

Load in TFlash using the command:
flash.load_model("frozen_inference_graph.pb")
or
flash = tflash.Detector("any_other_model_file.pb")

Metadata

Release files for tflash 0.4.5

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

Source distribution (sdist)

Source distribution for tflash 0.4.5
File Size Uploaded Provenance Actions
tflash-0.4.5.tar.gz 104.3 kB Without provenance Details for tflash-0.4.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tflash 0.4.5
File Interpreter ABI Platform Actions
tflash-0.4.5-py3-none-any.whl Python 3 none any Details for tflash-0.4.5-py3-none-any.whl

Total release size: 207.2 kB

Release files / tflash-0.4.5.tar.gz

Download URL tflash-0.4.5.tar.gz
Size 104.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4fcf14a162d6d782df84bd8d44ff9cf21fd8cfe9c62a71b6a8268d3af16baaf3
BLAKE2b-256 checksum
How to use checksums
d8091c680b8b8955da67d47d4b618dc087287ec519162b27572a4ac651b16715
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.9

Release files / tflash-0.4.5-py3-none-any.whl

Download URL tflash-0.4.5-py3-none-any.whl
Size 102.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5c0f2b73b6452273bddf4e2bf6c8f6fb6220b7c22f78dce7fa7c62bd0ef4532
BLAKE2b-256 checksum
How to use checksums
e0a34004b8295f7080df6837fa8ea169464373f16e938c546883e518e0f3c92f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.9

Security for tflash 0.4.5

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.

Release history Release notifications | RSS feed

This release

0.4.5 This release

2 release files No provenance

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