{"id":15683984,"url":"https://github.com/vfdev-5/imagedatasetviz","last_synced_at":"2025-10-25T06:09:19.318Z","repository":{"id":49877062,"uuid":"125773263","full_name":"vfdev-5/ImageDatasetViz","owner":"vfdev-5","description":"Observe the dataset of images and targets in few shots","archived":false,"fork":false,"pushed_at":"2022-09-27T16:33:44.000Z","size":7576,"stargazers_count":11,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-19T04:12:56.696Z","etag":null,"topics":["datasets","deeplearning","images","python","visualization"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vfdev-5.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-18T22:25:47.000Z","updated_at":"2024-11-06T12:48:31.000Z","dependencies_parsed_at":"2022-08-19T11:53:46.811Z","dependency_job_id":null,"html_url":"https://github.com/vfdev-5/ImageDatasetViz","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/vfdev-5/ImageDatasetViz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vfdev-5%2FImageDatasetViz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vfdev-5%2FImageDatasetViz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vfdev-5%2FImageDatasetViz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vfdev-5%2FImageDatasetViz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vfdev-5","download_url":"https://codeload.github.com/vfdev-5/ImageDatasetViz/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vfdev-5%2FImageDatasetViz/sbom","scorecard":{"id":919455,"data":{"date":"2025-08-11","repo":{"name":"github.com/vfdev-5/ImageDatasetViz","commit":"a21c253bcd1c6ab2ecf9e15f40149be6f3e0ede3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/deploy.yml:1","Warn: no topLevel permission defined: .github/workflows/tests.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/vfdev-5/ImageDatasetViz/deploy.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/vfdev-5/ImageDatasetViz/deploy.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/vfdev-5/ImageDatasetViz/tests.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/vfdev-5/ImageDatasetViz/tests.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/tests.yml:34","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-25T00:20:10.836Z","repository_id":49877062,"created_at":"2025-08-25T00:20:10.836Z","updated_at":"2025-08-25T00:20:10.836Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280912380,"owners_count":26412420,"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","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["datasets","deeplearning","images","python","visualization"],"created_at":"2024-10-03T17:09:24.815Z","updated_at":"2025-10-25T06:09:19.280Z","avatar_url":"https://github.com/vfdev-5.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# ImageDatasetViz\n\n[![Run unit tests](https://github.com/vfdev-5/ImageDatasetViz/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/vfdev-5/ImageDatasetViz/actions/workflows/tests.yml)\n\n\u003c!-- [![Build Status](https://travis-ci.org/vfdev-5/ImageDatasetViz.svg?branch=master)](https://travis-ci.org/vfdev-5/ImageDatasetViz) --\u003e\n\n\u003c!-- [![Coverage Status](https://coveralls.io/repos/github/vfdev-5/ImageDatasetViz/badge.svg?branch=master)](https://coveralls.io/github/vfdev-5/ImageDatasetViz?branch=master) --\u003e\n\nObserve dataset of images and targets in few shots\n\n![VEDAI example](examples/vedai_example.png)\n\n## Descriptions\n\nIdea is to create tools to store images, targets from a dataset as a few large images to observe the dataset\nin few shots.\n\n\n## Installation\n\n#### with pip\n\n```bash\n pip install image-dataset-viz\n```\n\n#### from sources\n```bash\npython setup.py install\n```\nor\n```bash\npip install git+https://github.com/vfdev-5/ImageDatasetViz.git\n```\n\n## Usage\n\n### Render a single datapoint\n\nFirst, we can just take a look on a single data point rendering. Let's assume that we\nhave `img` as, for example, `PIL.Image` and `target` as acceptable target type (`str` or list of points or\n`PIL.Image` mask, etc), thus we can generate a single image with target.\n\n```python\nfrom image_dataset_viz import render_datapoint\n\n# if target is a simple label\nres = render_datapoint(img, \"test label\", text_color=(0, 255, 0), text_size=10)\nplt.imshow(res)\n\n# if target is a mask image (PIL.Image)\nres = render_datapoint(img, target, blend_alpha=0.5)\nplt.imshow(res)\n\n# if target is a bounding box, e.g. np.array([[10, 10], [55, 10], [55, 77], [10, 77]])\nres = render_datapoint(img, target, geom_color=(255, 0, 0))\nplt.imshow(res)\n```\n\n#### Example output on Leaf Segmentation dataset from CVPPP2017\n\n![image with mask](examples/image_mask.png)  ![image with label](examples/image_label.png)  ![image with bbox label](examples/image_bbox_label.png)\n\n### Export complete dataset\nFor example, we have a dataset of image files and annotations files (polygons with labels):\n```python\nimg_files = [\n    '/path/to/image_1.ext',\n    '/path/to/image_2.ext',\n    ...\n    '/path/to/image_1000.ext',\n]\ntarget_files = [\n    '/path/to/target_1.ext2',\n    '/path/to/target_2.ext2',\n    ...\n    '/path/to/target_1000.ext2',\n]\n```\nWe can produce a single image composed of 20x50 small samples with targets to better visualize the whole dataset.\nLet's assume that we do need a particular processing to open the images in RGB 8bits format:\n```python\nfrom PIL import Image\n\ndef read_img_fn(img_filepath):\n    return Image.open(img_filepath).convert('RGB')\n```\nand let's say the annotations are just lines with points and a label, e.g. `12 23 34 45 56 67 car`\n```python\nfrom pathlib import Path\nimport numpy as np\n\ndef read_target_fn(target_filepath):\n    with Path(target_filepath).open('r') as handle:\n        points_labels = []\n        while True:\n            line = handle.readline()\n            if len(line) == 0:\n                break\n            splt = line[:-1].split(' ')  # Split into points and labels\n            label = splt[-1]\n            points = np.array(splt[:-1]).reshape(-1, 2)\n            points_labels.append((points, label))\n    return points_labels\n```\nNow we can export the dataset\n```python\nde = DatasetExporter(read_img_fn=read_img_fn, read_target_fn=read_target_fn,\n                     img_id_fn=lambda fp: Path(fp).stem, n_cols=20)\nde.export(img_files, target_files, output_folder=\"dataset_viz\")\n```\nand thus we should obtain a single png image with composed of 20x50 small samples.\n\n\n## Examples\n\n- [CIFAR10](examples/example_CIFAR10.ipynb)\n- [VEDAI](examples/example_VEDAI.ipynb)\n\n### Other basic examples\n\n#### Image and Mask/BBox/Label\n\n```python\nimport numpy as np\nfrom image_dataset_viz import render_datapoint, bbox_to_points\n\nimg = ((0, 0, 255) * np.ones((256, 256, 3))).astype(np.uint8)\nbbox = (\n    (bbox_to_points((10, 12, 145, 156)), \"A\"),\n    (bbox_to_points((109, 120, 215, 236)), \"B\"),\n)\n\nmask = 0 * np.ones((256, 256, 3), dtype=np.uint8)\nmask[34:145, 56:123, :] = 255\n\nres = render_datapoint(img, (mask, \"mask\", bbox), blend_alpha=0.5)\n```\n![result](https://user-images.githubusercontent.com/2459423/47006730-e417bc00-d136-11e8-82bd-eb13c153f03f.png)\n\n#### Image and Multi-Colored BBoxes\n\n```python\nimport numpy as np\nfrom image_dataset_viz import render_datapoint, bbox_to_points\n\n\nimg = ((0, 0, 255) * np.ones((256, 256, 3))).astype(np.uint8)\n\nmask = 0 * np.ones((256, 256, 3), dtype=np.uint8)\nmask[34:145, 56:123, :] = 255\n\ntargets = (\n    (mask, {\"blend_alpha\": 0.6}),\n    (\n        (bbox_to_points((10, 12, 145, 156)), \"A\"),\n        (bbox_to_points((109, 120, 215, 236)), \"B\"),\n        {\"geom_color\": (255, 255, 0)}\n    ),\n    (bbox_to_points((129, 140, 175, 186)), \"C\"),\n)\n\nres = render_datapoint(img, targets, blend_alpha=0.5)\n```\n\n![result](https://user-images.githubusercontent.com/2459423/47010583-bbe08b00-d13f-11e8-81e6-4df58f58e89e.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvfdev-5%2Fimagedatasetviz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvfdev-5%2Fimagedatasetviz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvfdev-5%2Fimagedatasetviz/lists"}