Skip to main content

Lost Cat (images) is a package for image related uris and tools

Project description

lost cat image library

used to collect the image processing libraries together

graph LR;
   A[Folders] --> B[data]
   A --> C[docs]
   A --> F[lost_cat_images]
   A --> E[test]
   A --> J[logs]
   B --> BT>stores data files]
   C --> CT>Documents and artifacts]
   F --> G[parsers]
   G --> GT>parser modules and classes]
   F --> H[processors]
   H --> HT>handles the queue load]
   F --> I[utils]
   I --> IT>useful helper modules and classes]
   E --> ET>test code]
   J --> JT>log files]

build

build.bat will build the library and will push to the PyPi Test and Main Repos, comment out the relevant lines, the PyPi upload expects the .pypirc file to be located in the %users folder%\%username% folder.

:: upload the package to pypi
:: https://packaging.python.org/en/latest/tutorials/packaging-projects/
python -m pip install --upgrade build
python -m build

:: test the package
::python -m twine upload --repository testpypi dist/*
::python -m pip install --index-url https://test.pypi.org/simple/ --no-deps lost_cat_medical

:: upload to pypi
python -m twine upload --repository pypi dist/*
python -m pip install --upgrade lost_cat_images

running tests

python -m unittest discover test

The results are output to the screen, and a log file is created for each unittest, \logs The source data for the test are in the \data folder

running the utility to process files

python lost_cat_images\examples\run_v2.py This will use the lci_config.json file. --config <path to config file> will allow the user to specify a different file to use for configuration.

example config files

{
            "paths":{
                "sources":[
                    {
                        "root": ".",
                        "folders": ["data"]
                    }
                ],
                "destination": {
                    "root": ".",
                    "folders": ["data", "twseu"]
                },
                "excel": {
                    "root": ".",
                    "folders": ["data", "twseu"],
                    "name": "yourFileName",
                    "ext": ".xlsx"
                },
                "ignore": [],
                "flags": {
                    "subs": false
                },
                "rules": [
                    {
                        "root": ".",
                        "folders": ["config"],
                        "name": "imgrules",
                        "ext": ".json"
                    }
                ]
            },
            "exports": {
                "data": [
                    "tx.raw",
                    "tx.texts",
                    "rr.detail",
                    "rr.ellipses"
                ],
                "images": [
                    "tx.markup",
                ]
            },
            "process":[
                "segmentation",
                "text",
                "grayscale",
                "threshold",
                "contours",
                "ellipses",
                "boxes",
                "grids",
                "rules"
            ],
            "caches":[
                "tx.texts"
            ],
            "segemtation":{
                "ranges": [
                    {"min":{"h": 20, "s": 0, "v": 200}, "max":{"h": 80, "s": 100, "v": 255}}
                ]
            },
            "denoise": {
                "mode": "bilateral",
                "diameter": 9,
                "sigmacolor": 75,
                "sigmaspace": 75
            },
            "grayscale": {
                "sourcetype": "BGR"
            },
            "contours": {
                "mode": 3,
                "method": 3
            },
            "ellipse": {
                "text_box_scale_ratio":1.1,
                "edge_detection_threshold":{
                    "threshold1":50,
                    "threshold2":150
                },
                "contours":{
                    "mode": 0,
                    "method": 2
                    },
                "filters":{
                    "min_contour_length":10,
                    "min_inertia_ratio":0.5,
                    "min_area": 3000,
                    "min_adjacent_distance":13
                }
            },
            "boxes": {
                "engine": "contour",
                "threshold": 0.4,
                "minsize": 25
            },
            "template": {},
            "text": {
                "engines": "azure"
            },
            "grids": {
                "minpath": 4,
                "band": 25
            },
            "count": -1
        }

Config File Sections

  • paths
    • sources - the source path for the scanner
      • root - should be a full path from a drive e.g., "C:/"
    • destination - where to save the intermediate objects and files
    • excel - path for the aoutput excel files
    • rules - path to the rules file
    • ignore: a list fo filenames to ignore
    • flags
      • subs: True | False sets whether to explore the sub directories or stay at the top level.
  • exports
    • images: a list of images to export to a file
    • data: a list of data object to export
  • processes: a list of processes to apply to the files, the order will be followed
  • caches: a list of objects to use as a cache to save calls
  • count: a flag (-1: all files, n: stop after n files)
  • <config name>: section for the configuration parameters to be passed to the processes

available processes

  • text
  • segmentation
  • denoise
  • grayscale
  • threshold
  • ellipses
  • boxes
  • grids
  • rules

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

lost_cat_images-1.1.0.tar.gz (82.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lost_cat_images-1.1.0-py3-none-any.whl (85.8 kB view details)

Uploaded Python 3

File details

Details for the file lost_cat_images-1.1.0.tar.gz.

File metadata

  • Download URL: lost_cat_images-1.1.0.tar.gz
  • Upload date:
  • Size: 82.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for lost_cat_images-1.1.0.tar.gz
Algorithm Hash digest
SHA256 9394c32715e93474e6a9aa19436476560fd85807b15dfd8101ed53a67495c5da
MD5 50803358f82b6dee010a70c9d00f7380
BLAKE2b-256 04d6c1771f22c757909a1e5f7dc80f8673812da66d33937751533198cf89239e

See more details on using hashes here.

File details

Details for the file lost_cat_images-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lost_cat_images-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e9d7129d94e36ebd17657373dc4071dfde86957bc369b3ed8e6d5b09d9cbd3f
MD5 778fc922b2670fd1df755cbb583983fd
BLAKE2b-256 cb0a7a043d29327b46c05fe814d96374803549dbe61dc9f94b34453b8e6bb611

See more details on using hashes here.

Supported by

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