{"id":34033633,"url":"https://github.com/lapix-ufsc/lapixdl","last_synced_at":"2026-04-09T04:04:54.082Z","repository":{"id":37894357,"uuid":"306032350","full_name":"lapix-ufsc/lapixdl","owner":"lapix-ufsc","description":"Python package with Deep Learning utilities for Computer Vision","archived":false,"fork":false,"pushed_at":"2026-04-06T21:23:49.000Z","size":335,"stargazers_count":9,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-06T23:21:23.651Z","etag":null,"topics":["computer-vision","deep-learning","evaluation-framework","image-processing"],"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/lapix-ufsc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-10-21T13:24:11.000Z","updated_at":"2025-06-23T21:50:14.000Z","dependencies_parsed_at":"2023-10-11T00:48:41.073Z","dependency_job_id":"adc15b2c-8ce1-44f9-9e8f-eb6cb3b582e9","html_url":"https://github.com/lapix-ufsc/lapixdl","commit_stats":{"total_commits":186,"total_committers":3,"mean_commits":62.0,"dds":0.5698924731182795,"last_synced_commit":"427054739d22bec7c6707a413880838c0bcf47e4"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/lapix-ufsc/lapixdl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lapix-ufsc%2Flapixdl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lapix-ufsc%2Flapixdl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lapix-ufsc%2Flapixdl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lapix-ufsc%2Flapixdl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lapix-ufsc","download_url":"https://codeload.github.com/lapix-ufsc/lapixdl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lapix-ufsc%2Flapixdl/sbom","scorecard":{"id":578882,"data":{"date":"2025-08-11","repo":{"name":"github.com/lapix-ufsc/lapixdl","commit":"9755b55747b029e37bc71b92134b79a2ec71e491"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/5 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":"Maintained","score":1,"reason":"2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"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":"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/python-publish.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":"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/python-publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/lapix-ufsc/lapixdl/python-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/lapix-ufsc/lapixdl/python-publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/lapix-ufsc/lapixdl/tests.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:24","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   2 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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENCE:0","Info: FSF or OSI recognized license: MIT License: LICENCE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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 30 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-20T18:37:12.054Z","repository_id":37894357,"created_at":"2025-08-20T18:37:12.054Z","updated_at":"2025-08-20T18:37:12.054Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31584831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"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":["computer-vision","deep-learning","evaluation-framework","image-processing"],"created_at":"2025-12-13T19:16:06.722Z","updated_at":"2026-04-09T04:04:54.077Z","avatar_url":"https://github.com/lapix-ufsc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![DOI](https://zenodo.org/badge/306032350.svg)](https://zenodo.org/badge/latestdoi/306032350) [![CodeFactor](https://www.codefactor.io/repository/github/lapix-ufsc/lapixdl/badge)](https://www.codefactor.io/repository/github/lapix-ufsc/lapixdl) [![PyPI](https://img.shields.io/pypi/v/lapixdl?color=blue\u0026label=pypi%20version)](https://pypi.org/project/lapixdl/) [![tests](https://github.com/lapix-ufsc/lapixdl/actions/workflows/tests.yml/badge.svg?branch=main\u0026event=schedule)](https://github.com/lapix-ufsc/lapixdl/actions/workflows/tests.yml)\n\n\n# LAPiX DL - Utils for Computer Vision Deep Learning research\n\nThis package contains utilitary functions to support train and evaluation of Deep Learning models applied to images.\n\nThree computer vision approaches are covered: Segmentation, Detection and Classification.\n\n## How to use\n\n### For Model Evaluation\n\nThis module exports the following functions for model evaluation:\n```python\nfrom lapixdl.evaluation.evaluate import evaluate_segmentation\nfrom lapixdl.evaluation.evaluate import evaluate_detection\nfrom lapixdl.evaluation.evaluate import evaluate_classification\n```\n\nAll model evaluation methods need two iterators: **one for the ground truth itens and one for the predictions**.\n\nThese iterators must be sorted equaly, assuring that the ground truth and the prediction of the same sample are at the same position.\n\n#### Example of segmentation model evaluation using **PyTorch**:\n\n```python\nfrom lapixdl.evaluation.evaluate import evaluate_segmentation\n\nclasses = ['background', 'object']\n\n# Iterator for GT masks\n# `dl` is a PyTorch DataLoader\ndef gt_mask_iterator_from_dl(dl):\n  for imgs, masks in iter(dl):\n    for mask in masks:\n      yield mask\n\n# Iterator for prediction masks\n# `predict` a function that, given an image, predicts the mask.\ndef pred_mask_iterator_from_dl(dl, predict):\n  for imgs, masks in iter(dl):\n    for img in imgs:\n      yield predict(img)\n\ngt_masks = gt_mask_iterator_from_dl(validation_dl)\npred_masks = pred_mask_iterator_from_dl(validation_dl, prediction_function)\n\n# Calculates and shows metrics\neval = evaluate_segmentation(gt_masks, pred_masks, classes)\n\n# Shows confusion matrix and returns its Figure and Axes\nfig, axes = eval.show_confusion_matrix()\n```\n\n#### Examples with third libraries\n\n##### How to log the results of LAPiX DL evaluations in the Weights \u0026 Biases platform\nAbout [Weights \u0026 Biases](https://docs.wandb.ai/).\n\n```python\nfrom lapixdl.evaluation.evaluate import evaluate_segmentation\nimport wandb\n\n# init wandb ...\n...\n\neval_test = evaluate_segmentation(gt_masks, pred_masks, categories)\n\n...\n\n# If you want to log everything\nwandb.log({'test_evaluation':  eval_test.to_dict()['By Class']})\n\n# If you want to choose specific categories to log\nselected_cats = ['A', 'B', 'C']\nmetrics_by_cat = {k: v for k, v in eval_test.to_dict()['By Class'].items() if k in selected_cats}\nwandb.log({'test_evaluation': metrics_by_cat})\n```\n\n##### Computing using GPU with `torchmetrics`\nAbout [torchmetrics](https://torchmetrics.readthedocs.io/en/stable/).\n\nThe lapixdl package calculates the confusion matrix first (on the CPU), which\nthis will be slower than calculating using `torchmetrics` which uses `pytorch`\n**tensors**. So a trick here, to not calculate each metric separately in\n`torchmetrics`, is to calculate a **confusion matrix** using `torchmetrics`\nand then calculate all the metrics at once using `lapixdl`.\n\nA simple example for a Segmentation case:\n\n```python\nimport torchmetrics\nfrom lapixdl.evaluation.model import SegmentationMetrics\n\nclasses = ['background', 'object']\n\nconfMat = torchmetrics.ConfusionMatrix(\n    reduce=\"macro\", mdmc_reduce=\"global\", num_classes=len(classes)\n)\n\nconfusion_matrix = confMat(pred, target)\nconfusion_matrix = confusion_matrix.numpy()\n\nmetrics = SegmentationMetrics(\n    classes=classes, confusion_matrix=confusion_matrix\n)\n```\n\n### For Results Visualization\n\nThis module exports the following functions for results visualization:\n```python\nfrom lapixdl.evaluation.visualize import show_segmentations\nfrom lapixdl.evaluation.visualize import show_classifications\nfrom lapixdl.evaluation.visualize import show_detections\n```\n\nThe available color maps are the [ones from matplotlib](https://matplotlib.org/3.1.1/gallery/color/colormap_reference.html).\n\n### For Data Conversion\nThis module exports the functions for data conversion.\n```python\nfrom lapixdl.convert import labelbox_to_lapix\nfrom lapixdl.convert import labelbox_to_coco\n```\n\n#### Example of conversion from **Labelbox** to **COCO** labels format:\n\n```python\nimport json\n\nfrom lapixdl.formats import labelbox_to_coco\n\n# A map categories between labelbox schematic id and category ID\nmap_categories = {\n  '\u003cschematic id from labelbox\u003e': 1 # category id\n}\n\n# The categories section in the COCO format\ncategories_coco = [{\n  'supercategory': None,\n  'name': 'example_category',\n  'id': 1\n}]\n\n# Convert it and create the COCO OD data\ncoco_dict = labelbox_to_coco(\n  'labelbox_export_file.json',\n  map_categories,\n  categories_coco,\n  target = 'object detection',\n  image_shape = (1200, 1600)\n)\n\n# Saves converted json\nwith open('./coco.json', 'w') as out_file:\n    json.dump(coco_dict, out_file)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flapix-ufsc%2Flapixdl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flapix-ufsc%2Flapixdl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flapix-ufsc%2Flapixdl/lists"}