Read, process, and integrate data from inventory cards.
Project description
Inventory Card Reader
This repository contains code to read, process, and integrate data from inventory cards. Currently it uses (pero-ocr)[https://github.com/DCGM/pero-ocr] for text recognition.
Installation
- Install the package from pip using
pip install inventory-card-reader
- Or clone the repository and do your thing
Prepare config files
- Create a config yaml file with the following keys:
xml_output_folder: <<temporary directory to store intermediate xml files>>
region_config: <<path to region config json>>
yolo_weights: <<path to trained yolo model to detect figures>>
output_dir: <<directory to store the resulting csv and extracted images>>
- Create a region config json file where the inventory card regions are defined. This file is expected to have the following structure:
{
"regions":
<<key1>>: [x1,y1,x2,y2]
<<key2>>: [x1,y1,x2,y2]
<<...>>: [...]
}
Where key define the column names to be extracted and x1,y1,x2,y2 denote the relative coordinates of the region where the values for the respective columns can be found in the inventory card. (x1,y1) denote the coordinates of the top left corner of the region, and x2,y2 the bottom right.
For example:
{
"regions": {
"Gegenstand": [0.047,0,1,0.077],
"Inv. Nr.": [0.047,0.077,0.275,0.135],
}
}
- Download the pero ocr model weights provided by the pero developers (here)[https://nextcloud.fit.vutbr.cz/s/NtAbHTNkZFpapdJ], unzip the file and store the .pt and .pt.cpu files in the pero_resources folder
- Start the extraction by invoking
read_inventory_cards <<config>> <<input_folder>>
where<<config>>
is the path to the config yaml file described above and<<input folder>>
the path to a directory of scanned jpgs of inventory cards to be processed.
Contributing
I'm happy to receive feedback and code contributions. Feel free to open issues or create pull requests.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file inventory_card_reader-0.0.10.tar.gz
.
File metadata
- Download URL: inventory_card_reader-0.0.10.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 113b7e60b792772c9321bc25e5bc0873db6cc03b3e96352659edf73ef8ae07ef |
|
MD5 | f7569c3f650989e02f626de3f0867c7d |
|
BLAKE2b-256 | 632698776455f4158e852e8257ef43639c0923319c47bd83ff9a1d77f029d36d |
File details
Details for the file inventory_card_reader-0.0.10-py3-none-any.whl
.
File metadata
- Download URL: inventory_card_reader-0.0.10-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d0616fe78cbfa2197862850bbb4abbac5daf76b48359e62030c8343ec6d8068 |
|
MD5 | 13a1257d2fbaf037e7416c58de8d1bbf |
|
BLAKE2b-256 | 0d774c90352de8897a3bf7b434949c2936c2ae815b7c92c13c6c141000cf5639 |