{"id":22706752,"url":"https://github.com/mbari-org/blaise","last_synced_at":"2026-03-10T13:31:18.735Z","repository":{"id":107429610,"uuid":"568643306","full_name":"mbari-org/blaise","owner":"mbari-org","description":"A utility to crop images according to given annotations (\"blazingly fast\")","archived":false,"fork":false,"pushed_at":"2024-09-04T03:10:11.000Z","size":364,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-10-20T01:17:40.740Z","etag":null,"topics":["classification","image-processing","pascal-voc","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbari-org.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-21T05:03:58.000Z","updated_at":"2025-02-25T22:27:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"35c763ec-39a7-4f62-a14e-44d61182cf40","html_url":"https://github.com/mbari-org/blaise","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/mbari-org/blaise","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbari-org%2Fblaise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbari-org%2Fblaise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbari-org%2Fblaise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbari-org%2Fblaise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbari-org","download_url":"https://codeload.github.com/mbari-org/blaise/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbari-org%2Fblaise/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30334632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T12:41:07.687Z","status":"ssl_error","status_checked_at":"2026-03-10T12:41:06.728Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["classification","image-processing","pascal-voc","rust"],"created_at":"2024-12-10T10:09:38.140Z","updated_at":"2026-03-10T13:31:18.670Z","avatar_url":"https://github.com/mbari-org.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# blaise\n\nA Rust implementation of [voc-cropper](https://github.com/mbari-org/voc-cropper).\n\nThis repo started as a learning exercise on how things like xml parsing and basic image processing\ncan be done in Rust. Along with the use of Rust mechanisms for CLI, file handling, multithreading,\nprogress report, etc., it only intended to reproduce the main functionality in voc-imagecropper,\nbut more features were subsequently added.\n\nNotable differences wrt voc-imagecropper include:\n- cropped images are written out in png format (not in jpeg)\n- no checks for minimum size\n- no summary of average of the images\n- for location of the images, along with the `--image-dir` option, only the `filename` attribute\n  is used from the xml \n- blaise can also ingest annotations in Yolo format (option `--yolo`)\n  (translation logic adopted from [yolo_to_voc.py](\n   https://bitbucket.org/mbari/m3-download/src/main/scripts/yolo_to_voc.py))\n- some additional options:\n  - `--bb-info \u003ccsv-file\u003e`\n  - `--max-ar \u003cvalue\u003e`\n  - `-j` to indicate number of threads to use\n\n## Installation\n\nA GitHub workflow builds and [releases](../../releases/) Linux and macOS binaries\nof the program.\n\nAlternatively, with Rust on your system, you can clone this repo and run:\n\n```shell\ncargo build --release\ncargo install --path .\n``` \nThis should put the executable in your `~/.cargo/bin` directory.\n\nThen, run `blaise --help` to see the usage.\n\nSimple example:\n\n```shell\nblaise --pascal data/annotations  --image-dir data/imgs --output-dir data/out\n```\n\n## Usage\n```shell\nblaise --help\n```\n```text\nCreates image crops for given annotations\n\nUsage: blaise [OPTIONS] --output-dir \u003cdir\u003e\n\nOptions:\n  -p, --pascal \u003cdir\u003e\n          Base directory to scan for pascal voc annotations\n  -y, --yolo \u003cimage-dir\u003e \u003clabel-dir\u003e \u003cnames-file\u003e\n          Use yolo annotations\n  -i, --image-dir \u003cdir\u003e\n          Image base directory\n      --max-ar \u003cAR\u003e\n          Only process images having at most the given aspect ratio\n  -r, --resize \u003cwidth\u003e \u003cheight\u003e\n          Resize the resulting crops (aspect ratio not necessarily preserved)\n  -L, --select-labels \u003clabels\u003e\n          Comma separated list of labels to crop. Defaults to everything\n  -o, --output-dir \u003cdir\u003e\n          Path to store image crops\n  -b, --bb-info \u003ccsv-file\u003e\n          Generate csv with size, aspect ratio of loaded bounding boxes\n      --verbose\n          Verbose output (disables progress bars)\n      --npb\n          Do not show progress bars\n  -j \u003cN\u003e\n          Number of threads to use (by default, all available)\n  -h, --help\n          Print help\n  -V, --version\n          Print version\n```\n\n\n## Development\n\nWe use [just](https://github.com/casey/just) for [various tasks](justfile).\nRun `just list` to see the available recipes.\n\n```shell\n$ just list \nAvailable recipes:\n    default                 # A convenient default for development: test and format\n    all                     # default + clippy; good to run before committing changes\n    list                    # List recipes\n    check                   # cargo check\n    test                    # Run tests\n    test-nocapture          # Run tests with --nocapture\n    run *args='-p data -o data/out' # Run program with basic example\n    rrun *args='-p data -o data/out' # Run program in release mode\n    tgz                     # Package source code\n    format                  # Format source code\n    clippy                  # Run clippy\n    build *args='--release' # Build\n    install                 # Install\n    outdated                # Show outdated dependencies\n    udeps                   # Find unused dependencies\n    update                  # cargo update\n```\n\nIn particular, be sure to run `just all`\nbefore committing/pushing any changes.\n\n## Misc links/refs\n\n- \u003chttps://docs.rs/serde-xml-rs/latest/serde_xml_rs/\u003e\n- \u003chttps://github.com/image-rs/image\u003e\n- \u003chttps://deterministic.space/\u003e\n- \u003chttps://www.reddit.com/r/rust/comments/7mu7q1/comment/drwoat0\u003e\n- \u003chttps://github.com/ritiek/auto-image-cropper\u003e\n- \u003chttps://github.com/console-rs/indicatif\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbari-org%2Fblaise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbari-org%2Fblaise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbari-org%2Fblaise/lists"}