{"id":22249719,"url":"https://github.com/jakubvalenta/image-marker","last_synced_at":"2025-03-25T12:15:14.603Z","repository":{"id":69037167,"uuid":"103047760","full_name":"jakubvalenta/image-marker","owner":"jakubvalenta","description":"Mark rectangular areas in a batch of images and save the output as a CSV","archived":false,"fork":false,"pushed_at":"2020-07-11T15:08:30.000Z","size":4454,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T11:11:40.285Z","etag":null,"topics":["batch","collection","graphics","image","mark","rectangle"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jakubvalenta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-09-10T17:22:54.000Z","updated_at":"2020-07-11T15:10:03.000Z","dependencies_parsed_at":"2023-03-02T07:45:44.022Z","dependency_job_id":null,"html_url":"https://github.com/jakubvalenta/image-marker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubvalenta%2Fimage-marker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubvalenta%2Fimage-marker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubvalenta%2Fimage-marker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubvalenta%2Fimage-marker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakubvalenta","download_url":"https://codeload.github.com/jakubvalenta/image-marker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245458703,"owners_count":20618697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["batch","collection","graphics","image","mark","rectangle"],"created_at":"2024-12-03T06:28:22.623Z","updated_at":"2025-03-25T12:15:14.570Z","avatar_url":"https://github.com/jakubvalenta.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image Marker\n\nA graphical program to mark rectangular areas in a batch of images and save\ntheir coordinates as a CSV. Optionally, add a text note to each of the\nimages. Optimized for a fast workflow.\n\n![Image Marker screenshot](./docs/image-marker-screenshot.png)\n\nOutput CSV format:\n\n``` csv\n\u003cimage path\u003e \u003cleft px\u003e \u003ctop px\u003e \u003cwidth px\u003e \u003cheight px\u003e\n```\n\nExample:\n\n``` csv\n./test_images/building.jpg 350 237 909 547\n./test_images/canal.jpg 530 533 1075 252\n```\n\nThis is all Image Marker does. You can do whatever you want with the output\nCSV. One obvious option is to crop the images according to the marks. You can\nuse [image-crop](https://github.com/jakubvalenta/image-crop) for that.\n\n## Installation\n\n``` shell\npip install --user --upgrade .\n```\n\n## Usage\n\n1. Put all the images you want to mark in a single directory.\n\n2. Run Image Marker:\n\n    ``` shell\n    image-marker ./my_directory --marks my_marks.csv --output my_output.csv --box-ratio 1.33 --box-padding 0.1\n    ```\n\n    The positional argument specifies the directory to load the images from.\n\n    The option `--marks` specifies the CSV file path, where the coordinates of\n    the marked rectangles will be saved.\n\n    The option `--output` specifies the CSV file path, where the post-processed\n    coordinates will be saved. More on that later.\n\n3. A window will appear with the first image in the directory. Use the mouse to\n   draw a rectangular mark. The output CSV files are saved immediately.\n\n    ![Image Marker screenshot - mark](./docs/image-marker-screenshot-mark.png)\n\n    If you're not happy with the mark position or size, draw it again. The\n    previously drawn rectangle will disappear.\n\n4. Use the \u003ckbd\u003eright\u003c/kbd\u003e arrow key to advance to the next image.\n\n    You can also go back using the \u003ckbd\u003eleft\u003c/kbd\u003e arrow key.\n\n5. Type any characters on your keyboard to add a text note to an image. It will\n   appear in blue by the bottom edge of the window. You can delete what you've\n   typed using the \u003ckbd\u003ebackspace\u003c/kbd\u003e key.\n\n    ![Image Marker screenshot - note](./docs/image-marker-screenshot-note.png)\n\n6. Quit the program by pressing the \u003ckbd\u003eesc\u003c/kbd\u003e key.\n\n### Mark post-processing\n\nBy default the values stored in the `--marks` and `--output` CSV files are the\nsame.\n\nHowever, it is possible to make some automatic adjustments to your marks. In\nthis case, the original marks will be stored in the `--marks` CSV file and the\npost-processed marks in the `--output` CSV file.\n\nThere is currently one post-processing option:\n\n#### Box\n\nIf you want to create a set of marks that all have the same aspect ratio, you\ncan use the option `--box-ratio` to automatically draw a box around each mark\nwith a specified aspect ratio. The box will be drawn symmetrically around the\nmarked area as a green rectangle. If the box doesn't fit in the image, it will\nbe moved in the image.\n\n![Image Marker screenshot - box](./docs/image-marker-screenshot-box.png)\n\nYou can also add padding to the box using the option `--box-padding`. It is\ndefined as a fraction of the marked rectangle width. For instance `--box-padding\n0.15` will result in a 30 px padding for a 200 px wide mark.\n\n![Image Marker screenshot - box with padding](./docs/image-marker-screenshot-box-with-padding.png)\n\n## Controls\n\n- \u003ckbd\u003eright\u003c/kbd\u003e or \u003ckbd\u003edown\u003c/kbd\u003e or \u003ckbd\u003eenter\u003c/kbd\u003e: show next image\n- \u003ckbd\u003eleft\u003c/kbd\u003e or\u003ckbd\u003eup\u003c/kbd\u003e: show previous image\n- left mouse click and drag: draw a mark\n- left mouse click (no drag): delete current mark\n- \u003ckbd\u003eesc\u003c/kbd\u003e: exit the program (all marks are automatically saved)\n- letter and number keys: add text note to current image\n- \u003ckbd\u003ebackspace\u003c/kbd\u003e: delete the last character of the text note\n\n## Help\n\n``` shell\nimage-marker --help\n```\n\n## Contributing\n\n__Feel free to remix this piece of software.__ See [NOTICE](./NOTICE) and\n[LICENSE](./LICENSE) for license information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakubvalenta%2Fimage-marker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakubvalenta%2Fimage-marker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakubvalenta%2Fimage-marker/lists"}