{"id":25217943,"url":"https://github.com/nota-netspresso/pynetspresso","last_synced_at":"2025-10-25T17:31:08.278Z","repository":{"id":174863626,"uuid":"649582676","full_name":"Nota-NetsPresso/PyNetsPresso","owner":"Nota-NetsPresso","description":"The official NetsPresso Python package.","archived":false,"fork":false,"pushed_at":"2024-08-13T06:24:20.000Z","size":62444,"stargazers_count":38,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2024-08-13T10:26:22.497Z","etag":null,"topics":["benchmarker","compressor","converter","netspresso","trainer"],"latest_commit_sha":null,"homepage":"https://nota-netspresso.github.io/PyNetsPresso/","language":"Jupyter Notebook","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/Nota-NetsPresso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":"SUPPORT_OPTIONS.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-05T07:40:01.000Z","updated_at":"2024-08-16T05:27:02.067Z","dependencies_parsed_at":"2023-12-18T05:43:14.380Z","dependency_job_id":"bc1d08bf-2c1b-4195-9930-52d409d52c60","html_url":"https://github.com/Nota-NetsPresso/PyNetsPresso","commit_stats":null,"previous_names":["nota-netspresso/netspresso-python","nota-netspresso/pynp-python-package","nota-netspresso/pynetspresso"],"tags_count":72,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nota-NetsPresso%2FPyNetsPresso","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nota-NetsPresso%2FPyNetsPresso/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nota-NetsPresso%2FPyNetsPresso/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nota-NetsPresso%2FPyNetsPresso/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nota-NetsPresso","download_url":"https://codeload.github.com/Nota-NetsPresso/PyNetsPresso/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238188598,"owners_count":19430874,"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":["benchmarker","compressor","converter","netspresso","trainer"],"created_at":"2025-02-10T20:52:49.443Z","updated_at":"2025-10-25T17:31:03.213Z","avatar_url":"https://github.com/Nota-NetsPresso.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=right\u003e\n  \u003ca href=\"https://hits.seeyoufarm.com\"\u003e\u003cimg src=\"https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FNota-NetsPresso%2Fnetspresso-python\u0026count_bg=%2323E7E7E7\u0026title_bg=%23555555\u0026icon=\u0026icon_color=%23E7E7E7\u0026title=hits\u0026edge_flat=false\"/\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://netspresso.ai/?utm_source=git\u0026utm_medium=banner_py\u0026utm_campaign=np_renew\" target=\"_blank\"\u003e\u003cimg src=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/banner/NetsPresso2.0_banner.png\"/\u003e\n\u003c/div\u003e\n\u003c/br\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://netspresso.ai/?utm_source=git\u0026utm_medium=text_signup\u0026utm_campaign=np_renew\"\u003e Sign Up \u003c/a\u003e\n    | \u003ca href=\"https://nota-netspresso.github.io/PyNetsPresso\"\u003e Docs \u003c/a\u003e \n\u003c/div\u003e\n\u003c/br\u003e\n\n\n\n\u003cdiv align=\"center\"\u003e\n  🔥 NetsPresso Tutorials (Google Colab) 🔥 \u003cbr\u003e\n    \u003ca href=\"https://colab.research.google.com/drive/15HBp88qfUDQl5PaEcZ5J-dnLo-1kvw-a\"\u003e NetsPresso Tutorial(with Compressor) \u003c/a\u003e\u003c/br\u003e\n    \u003ca href=\"https://colab.research.google.com/drive/1IJq9QXgQWVIdPasVApT1lrGyvrKq--Pp?usp=sharing\"\u003e NetsPresso Tutorial(with Quantizer) \u003c/a\u003e\u003c/br\u003e\n\u003c/div\u003e\n\u003c/br\u003e\n\n\u003cdiv align=\"center\"\u003e\n  ☀️ NetsPresso Model Zoo ☀️ \u003cbr\u003e\n      \u003ca href=\"https://github.com/Nota-NetsPresso/ModelZoo-YOLOFastest-for-ARM-U55-M85\"\u003e YOLO Fastest \u003c/a\u003e\n    | \u003ca href=\"https://github.com/Nota-NetsPresso/yolox_nota\"\u003e YOLOX \u003c/a\u003e\n    | \u003ca href=\"https://github.com/Nota-NetsPresso/ultralytics_nota\"\u003e YOLOv8 \u003c/a\u003e \n    | \u003ca href=\"https://github.com/Nota-NetsPresso/ModelZoo-YOLOv7\"\u003e YOLOv7 \u003c/a\u003e \n    | \u003ca href=\"https://github.com/Nota-NetsPresso/yolov5_nota\"\u003e YOLOv5 \u003c/a\u003e \n    | \u003ca href=\"https://github.com/Nota-NetsPresso/PIDNet_nota\"\u003e PIDNet \u003c/a\u003e     \n    | \u003ca href=\"https://github.com/Nota-NetsPresso/pytorch-cifar-models_nota\"\u003e PyTorch-CIFAR-Models\u003c/a\u003e\n\u003c/div\u003e\n\u003c/br\u003e\n\n\u003cdiv align=\"center\"\u003e\n  🌟 STMicro x NetsPresso 🌟 \u003cbr\u003e\n      \u003ca href=\"https://github.com/STMicroelectronics/stm32ai-modelzoo\"\u003e STM32 model zoo\u003c/a\u003e\n\u003c/div\u003e\n\u003c/br\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003cp align=\"center\"\u003e\n        \u003ca href=\"https://www.python.org/downloads/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10-blue?style=flat\u0026logo=python\u0026logoColor=blue\" /\u003e\n        \u003ca href=\"https://pytorch.org/\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/PyTorch-1.11.x ~ 1.13.x.-EE4C2C?style=flat\u0026logo=pytorch\u0026logoColor=#EE4C2C\"/\u003e\u003c/a\u003e\n        \u003ca href=\"https://www.tensorflow.org/install/pip\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/TensorFlow-2.3.x ~ 2.8.x.-FF6F00?style=flat\u0026logo=tensorflow\u0026logoColor=#FF6F00\u0026link=https://www.tensorflow.org/install/pip\"/\u003e\u003c/a\u003e\n        \u003cbr\u003e\n        \u003ca href=\"https://netspresso.ai/?utm_source=git\u0026utm_medium=badge\u0026utm_campaign=np_renew\"\u003e\u003cimg src=\"https://img.shields.io/badge/NetsPresso-Open in Website-1BD2EB?style=flat\u0026link=https://netspresso.ai/\"/\u003e\u003c/a\u003e\n        \u003ca href=\"https://colab.research.google.com/drive/15HBp88qfUDQl5PaEcZ5J-dnLo-1kvw-a\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/Best Practice-Open in Colab-F9AB00?style=flat\u0026logo=googlecolab\u0026logoColor=#F9AB00\"/\u003e\u003c/a\u003e\n    \u003c/p\u003e\n\u003c/div\u003e\n\u003c/br\u003e\n\nUse **NetsPresso** for a seamless model optimization process. \nNetsPresso resolves AI-related constraints in business use cases and enables cost-efficiency and enhanced performance by removing the requirement for high-spec servers and network connectivity and preventing high latency and personal data breaches.\n\nEasily compress various models with our resources. Please browse the [Docs] for details, and join our [Discussion Forum] for providing feedback or sharing your use cases.\n\nTo get started with NetsPresso, you'll need to sign up [here](https://netspresso.ai/?utm_source=git\u0026utm_medium=text_signup\u0026utm_campaign=np_renew).\n\nWe offer a comprehensive guide to walk you through the process of optimizing an AI model using NetsPresso. A full tutorial can be found [Google Colab](https://colab.research.google.com/drive/15HBp88qfUDQl5PaEcZ5J-dnLo-1kvw-a).\n\u003c/br\u003e\n\u003c/br\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Nota-NetsPresso\" style=\"text-decoration:none;\"\u003e\n    \u003cpicture\u003e\n      \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/common/github_white.png\"\u003e\n      \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/common/github.png\"\u003e\n      \u003cimg alt=\"github\" src=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/common/github.png\" width=\"3%\"\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/common/logo-transparent.png\" width=\"3%\" alt=\"\" /\u003e\n  \u003ca href=\"https://www.facebook.com/NotaAI\" style=\"text-decoration:none;\"\u003e\n    \u003cpicture\u003e\n      \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/common/facebook_white.png\"\u003e\n      \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/common/facebook.png\"\u003e\n      \u003cimg alt=\"facebook\" src=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/common/facebook.png\" width=\"3%\"\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/common/logo-transparent.png\" width=\"3%\" alt=\"\" /\u003e\n  \u003ca href=\"https://twitter.com/nota_ai\" style=\"text-decoration:none;\"\u003e\n    \u003cpicture\u003e\n      \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/common/twitter_white.png\"\u003e\n      \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/common/twitter.png\"\u003e\n      \u003cimg alt=\"twitter\" src=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/common/twitter.png\" width=\"3%\"\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/common/logo-transparent.png\" width=\"3%\" alt=\"\" /\u003e\n  \u003ca href=\"https://www.youtube.com/channel/UCeewYFAqb2EqwEXZCfH9DVQ\" style=\"text-decoration:none;\"\u003e\n    \u003cpicture\u003e\n      \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/common/youtube_white.png\"\u003e\n      \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/common/youtube.png\"\u003e\n      \u003cimg alt=\"youtube\" src=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/common/youtube.png\" width=\"3%\"\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/common/logo-transparent.png\" width=\"3%\" alt=\"\" /\u003e\n  \u003ca href=\"https://www.linkedin.com/company/nota-incorporated\" style=\"text-decoration:none;\"\u003e\n    \u003cpicture\u003e\n      \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/common/linkedin_white.png\"\u003e\n      \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/common/linkedin.png\"\u003e\n      \u003cimg alt=\"youtube\" src=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/common/linkedin.png\" width=\"3%\"\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\u003c/br\u003e\n\u003c/br\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg width=\"100%\" src=\"https://netspresso-docs-imgs.s3.ap-northeast-2.amazonaws.com/imgs/banner/github_pipeline_temp.png\"\u003e\n\u003c/div\u003e\n\u003c/br\u003e\n\n\u003cdiv width=\"9%\" align=\"center\"\u003e\n  \u003ctable width=\"90%\" align=\"center\"\u003e\n      \u003ctr\u003e\n          \u003cth\u003eStep\u003c/th\u003e\n          \u003cth\u003eType\u003c/th\u003e\n          \u003cth\u003eDescription\u003c/th\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd width=\"30%\" align=\"center\" rowspan=\"2\"\u003eTrain\u003c/td\u003e\n          \u003ctd width=\"30%\" align=\"center\"\u003enp.trainer\u003c/td\u003e\n          \u003ctd width=\"40%\" align=\"center\" rowspan=\"2\"\u003eBuild and train a model.\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd width=\"30%\" align=\"center\"\u003e\n            \u003cdetails\u003e\n              \u003csummary\u003eModel Zoo\u003c/summary\u003e\n              \u003cdetails\u003e\n                  \u003csummary\u003eImage Classification\u003c/summary\u003e\n                  \u003ca href=\"https://github.com/Nota-NetsPresso/pytorch-cifar-models_nota\"\u003ePyTorch-CIFAR-Models\u003c/a\u003e\n              \u003c/details\u003e\n              \u003cdetails\u003e\n                  \u003csummary\u003eObject Detection\u003c/summary\u003e\n                  \u003ca href=\"https://github.com/Nota-NetsPresso/ModelZoo-YOLOFastest-for-ARM-U55-M85\"\u003eYOLO Fastest\u003c/a\u003e\u003cbr\u003e\n                  \u003ca href=\"https://github.com/Nota-NetsPresso/yolox_nota\"\u003eYOLOX\u003c/a\u003e\u003cbr\u003e\n                  \u003ca href=\"https://github.com/Nota-NetsPresso/yolov5_nota\"\u003eYOLOv5\u003c/a\u003e\u003cbr\u003e\n                  \u003ca href=\"https://github.com/Nota-NetsPresso/ModelZoo-YOLOv7\"\u003eYOLOv7\u003c/a\u003e\n              \u003c/details\u003e\n              \u003cdetails\u003e\n                  \u003csummary\u003eSemantic Segmentation\u003c/summary\u003e\n                  \u003ca href=\"https://github.com/Nota-NetsPresso/PIDNet_nota\"\u003ePIDNet\u003c/a\u003e\n              \u003c/details\u003e\n              \u003cdetails\u003e\n                  \u003csummary\u003ePose Estimation\u003c/summary\u003e\n                  \u003ca href=\"https://github.com/Nota-NetsPresso/ultralytics_nota\"\u003eYOLOv8\u003c/a\u003e\n              \u003c/details\u003e\n            \u003c/details\u003e\n          \u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd width=\"30%\" align=\"center\"\u003eCompress\u003c/td\u003e\n          \u003ctd width=\"30%\" align=\"center\"\u003enp.compressor\u003c/td\u003e\n          \u003ctd width=\"40%\" align=\"center\"\u003eCompress and optimize the user’s model.\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd width=\"30%\" align=\"center\"\u003eQuantize\u003c/td\u003e\n          \u003ctd width=\"30%\" align=\"center\"\u003enp.quantizer\u003c/td\u003e\n          \u003ctd width=\"40%\" align=\"center\"\u003eQuantize the user’s model.\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd width=\"30%\" align=\"center\"\u003eConvert\u003c/td\u003e\n          \u003ctd width=\"30%\" align=\"center\"\u003enp.converter\u003c/td\u003e\n          \u003ctd width=\"40%\" align=\"center\"\u003eConvert and quantize the user’s model to run efficiently on device.\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd width=\"30%\" align=\"center\"\u003eBenchmark\u003c/td\u003e\n          \u003ctd width=\"30%\" align=\"center\"\u003enp.benchmarker\u003c/td\u003e\n          \u003ctd width=\"40%\" align=\"center\"\u003eBenchmark the user's model to measure model inference speed on diverse device.\u003c/td\u003e\n      \u003c/tr\u003e\n  \u003c/table\u003e\n\u003c/div\u003e\n\n## Installation\n\n### Prerequisites\n\n- Python `3.8` | `3.9` | `3.10`\n- PyTorch `1.13.0` (recommended) (compatible with: `1.11.x` - `1.13.x`)\n- TensorFlow `2.8.0` (recommended) (compatible with: `2.3.x` - `2.8.x`)\n\n### Install with PyPI (stable)\n\n```bash\npip install netspresso\n```\n\nTo use **editable mode** or **docker**, see [INSTALLATION.md](INSTALLATION.md).\n\n## Getting started\n\n### Login\n\nLog-in to your netspresso account. Please sign-up [here](https://netspresso.ai/?utm_source=git\u0026utm_medium=text_signup2\u0026utm_campaign=np_renew) if you need one.\n\n```python\nfrom netspresso import NetsPresso\n\nnetspresso = NetsPresso(email=\"YOUR_EMAIL\", password=\"YOUR_PASSWORD\")\n```\n\n### ⭐⭐⭐ (New Feature) Quantizer ⭐⭐⭐\n\n#### Automatic quantization\n\nTo start quantize a model, enter the model path, dataset path, and the desired quantization precision.\n\nThe quantized model will be saved to the specified output directory (`output_dir`).\n\n```python\nfrom netspresso.enums import QuantizationPrecision, SimilarityMetric\n\n# 1. Declare quantizer\nquantizer = netspresso.quantizer()\n\n# 2. Run automatic quantization\nquantization_result = quantizer.automatic_quantization(\n    input_model_path=\"./examples/sample_models/test.onnx\",\n    output_dir=\"./outputs/quantized/automatic_quantization\",\n    dataset_path=\"./examples/sample_datasets/pickle_calibration_dataset_128x128.npy\",\n    weight_precision=QuantizationPrecision.INT8,\n    activation_precision=QuantizationPrecision.INT8,\n    threshold=0,\n)\n```\n\n#### Custom precision quantization by layer name\n\nThis method enables you to apply precision settings tailored to each layer, based on the recommendations, to optimize model.\n\nOr, you can modify it to your desired precision and optimize it.\n\n```python\nfrom netspresso.enums import QuantizationPrecision\n\n# 1. Declare quantizer\nquantizer = netspresso.quantizer()\n\n# 2. Recommendation precision\nmetadata = quantizer.get_recommendation_precision(\n    input_model_path=\"./examples/sample_models/test.onnx\",\n    output_dir=\"./outputs/quantized/recommendation\",\n    dataset_path=\"./examples/sample_datasets/pickle_calibration_dataset_128x128.npy\",\n    weight_precision=QuantizationPrecision.INT8,\n    activation_precision=QuantizationPrecision.INT8,\n    threshold=0,\n)\nrecommendation_precisions = quantizer.load_recommendation_precision_result(metadata.recommendation_result_path)\n\n# 2. Run quantization by layer name\nquantization_result = quantizer.custom_precision_quantization_by_layer_name(\n    input_model_path=\"./examples/sample_models/test.onnx\",\n    output_dir=\"./outputs/quantized/custom_precision_quantization_by_layer_name\",\n    precision_by_layer_name=recommendation_precisions.layers,\n    dataset_path=\"./examples/sample_datasets/pickle_calibration_dataset_128x128.npy\",\n)\n```\n\n\n### Trainer\n\n#### Train\n\nTo start training a model, first select a task. \n\nThen configure the dataset, model, augmentation, and hyperparameters. \n\nOnce setup is finished, enter the GPU number and project name for training.\n\n```python\nfrom netspresso.enums import Task\nfrom netspresso.trainer.optimizers import AdamW\nfrom netspresso.trainer.schedulers import CosineAnnealingWarmRestartsWithCustomWarmUp\nfrom netspresso.trainer.augmentations import Resize\n\n\n# 1. Declare trainer\ntrainer = netspresso.trainer(task=Task.OBJECT_DETECTION)  # IMAGE_CLASSIFICATION, OBJECT_DETECTION, SEMANTIC_SEGMENTATION\n\n# 2. Set config for training\n# 2-1. Data\ntrainer.set_dataset_config(\n    name=\"traffic_sign_config_example\",\n    root_path=\"/root/traffic-sign\",\n    train_image=\"images/train\",\n    train_label=\"labels/train\",\n    valid_image=\"images/valid\",\n    valid_label=\"labels/valid\",\n    id_mapping=[\"prohibitory\", \"danger\", \"mandatory\", \"other\"],\n)\n\n# 2-2. Model\nprint(trainer.available_models)  # ['YOLOX-S', 'YOLOX-M', 'YOLOX-L', 'YOLOX-X']\ntrainer.set_model_config(model_name=\"YOLOX-S\", img_size=512)\n\n# 2-3. Augmentation\ntrainer.set_augmentation_config(\n    train_transforms=[Resize()],\n    inference_transforms=[Resize()],\n)\n\n# 2-4. Training\noptimizer = AdamW(lr=6e-3)\nscheduler = CosineAnnealingWarmRestartsWithCustomWarmUp(warmup_epochs=10)\ntrainer.set_training_config(\n    epochs=40,\n    batch_size=16,\n    optimizer=optimizer,\n    scheduler=scheduler,\n)\n\n# 3. Train\ntraining_result = trainer.train(gpus=\"0, 1\", project_name=\"PROJECT_TRAIN_SAMPLE\")\n```\n\n#### Retrain\n\nTo start retraining a model, use `hparams.yaml` file which is one of the artifacts generated during the training of the original model.\n\nThen, enter the compressed model path, which is an artifact of the compressor in fx_model_path.\n\nAdjust the training hyperparameters as needed. (See 2-2. for detailed code.)\n\n```python\nfrom netspresso.trainer.optimizers import AdamW\n\n# 1. Declare trainer\ntrainer = netspresso.trainer(yaml_path=\"./temp/hparams.yaml\")\n\n# 2. Set config for retraining\n# 2-1. FX Model\ntrainer.set_fx_model(fx_model_path=\"./temp/FX_MODEL_PATH.pt\")\n\n# 2-2. Training\noptimizer = AdamW(lr=6e-3)\ntrainer.set_training_config(\n    epochs=30,\n    batch_size=16,\n    optimizer=optimizer,\n)\n\n# 3. Train\nretraining_result = trainer.train(gpus=\"0, 1\", project_name=\"PROJECT_RETRAIN_SAMPLE\")\n```\n\n### Compressor\n\n#### Compress (Automatic compression)\n\nTo start compressing a model, enter the model path to compress and the appropriate compression ratio.\n\nThe compressed model will be saved in the specified output directory (`output_dir`).\n\n```python\n# 1. Declare compressor\ncompressor = netspresso.compressor_v2()\n\n# 2. Run automatic compression\ncompression_result = compressor.automatic_compression(\n    input_shapes=[{\"batch\": 1, \"channel\": 3, \"dimension\": [224, 224]}],\n    input_model_path=\"./examples/sample_models/graphmodule.pt\",\n    output_dir=\"./outputs/compressed/pytorch_automatic_compression\",\n    compression_ratio=0.5,\n)\n```\n\n### Converter\n\n#### Convert\n\nTo start converting a model, enter the model path to convert and the target framework and device name.\n\nFor NVIDIA GPUs and Jetson devices, enter the software version additionally due to the jetpack version.\n\nThe converted model will be saved in the specified output directory (`output_dir`).\n\n```python\nfrom netspresso.enums import DeviceName, Framework, SoftwareVersion\n\n# 1. Declare converter\nconverter = netspresso.converter_v2()\n\n# 2. Run convert\nconversion_result = converter.convert_model(\n    input_model_path=\"./examples/sample_models/test.onnx\",\n    output_dir=\"./outputs/converted/TENSORRT_JETSON_AGX_ORIN_JETPACK_5_0_1\",\n    target_framework=Framework.TENSORRT,\n    target_device_name=DeviceName.JETSON_AGX_ORIN,\n    target_software_version=SoftwareVersion.JETPACK_5_0_1,\n)\n```\n\n### Benchmarker\n\n#### Benchmark\n\nTo start benchmarking a model, enter the model path to benchmark and the target device name.\n\nFor NVIDIA GPUs and Jetson devices, device name and software version have to be matched with the target device of the conversion.\n\nTensorRT Model has strong dependency with the device type and its jetpack version.\n\n```python\nfrom netspresso.enums import DeviceName, SoftwareVersion\n\n# 1. Declare benchmarker\nbenchmarker = netspresso.benchmarker_v2()\n\n# 2. Run benchmark\nbenchmark_result = benchmarker.benchmark_model(\n    input_model_path=\"./outputs/converted/TENSORRT_JETSON_AGX_ORIN_JETPACK_5_0_1/TENSORRT_JETSON_AGX_ORIN_JETPACK_5_0_1.trt\",\n    target_device_name=DeviceName.JETSON_AGX_ORIN,\n    target_software_version=SoftwareVersion.JETPACK_5_0_1,\n)\nprint(f\"model inference latency: {benchmark_result.benchmark_result.latency} ms\")\nprint(f\"model gpu memory footprint: {benchmark_result.benchmark_result.memory_footprint_gpu} MB\")\nprint(f\"model cpu memory footprint: {benchmark_result.benchmark_result.memory_footprint_cpu} MB\")\n```\n\n\u003cdetails open\u003e\n  \u003csummary\u003eSupported options for Converter \u0026 Benchmarker\u003c/summary\u003e\n  \u003cdiv markdown=\"1\"\u003e\n\n  ### Frameworks that support conversion for model's framework\n\n  | Target / Source Framework | ONNX | TENSORFLOW_KERAS | TENSORFLOW |\n  |:--------------------------|:----:|:----------------:|:----------:|\n  | TENSORRT                  |  ✔️  |                  |            |\n  | DRPAI                     |  ✔️  |                  |            |\n  | OPENVINO                  |  ✔️  |                  |            |\n  | TENSORFLOW_LITE           |  ✔️  |        ✔️        |     ✔️     |\n\n  ### Devices that support benchmarks for model's framework\n\n  | Device / Framework           | ONNX | TENSORRT | TENSORFLOW_LITE | DRPAI | OPENVINO |\n  |:-----------------------------|:----:|:--------:|:---------------:|:-----:|:--------:|\n  | RASPBERRY_PI_5               |  ✔️  |          |       ✔️        |       |          |\n  | RASPBERRY_PI_4B              |  ✔️  |          |       ✔️        |       |          |\n  | RASPBERRY_PI_3B_PLUS         |  ✔️  |          |       ✔️        |       |          |\n  | RASPBERRY_PI_ZERO_W          |  ✔️  |          |       ✔️        |       |          |\n  | RASPBERRY_PI_ZERO_2W         |  ✔️  |          |       ✔️        |       |          |\n  | ARM_ETHOS_U_SERIES           |      |          |  ✔️(only INT8)  |       |          |\n  | ALIF_ENSEMBLE_E7_DEVKIT_GEN2 |      |          |  ✔️(only INT8)  |       |          |\n  | RENESAS_RA8D1                |      |          |  ✔️(only INT8)  |       |          |\n  | NXP_iMX93                    |      |          |  ✔️(only INT8)  |       |          |\n  | ARDUINO_NICLA_VISION         |      |          |  ✔️(only INT8)  |       |          |\n  | RENESAS_RZ_V2L               |  ✔️  |          |                 |  ✔️   |          |\n  | RENESAS_RZ_V2M               |  ✔️  |          |                 |  ✔️   |          |\n  | JETSON_NANO                  |  ✔️  |    ✔️    |                 |       |          |\n  | JETSON_TX2                   |  ✔️  |    ✔️    |                 |       |          |\n  | JETSON_XAVIER                |  ✔️  |    ✔️    |                 |       |          |\n  | JETSON_NX                    |  ✔️  |    ✔️    |                 |       |          |\n  | JETSON_AGX_ORIN              |  ✔️  |    ✔️    |                 |       |          |\n  | JETSON_ORIN_NANO             |  ✔️  |    ✔️    |                 |       |          |\n  | AWS_T4                       |  ✔️  |    ✔️    |                 |       |          |\n  | INTEL_XEON_W_2233            |      |          |                 |       |    ✔️    |\n\n  ### Software versions that support conversions and benchmarks for specific devices \n\n  Software Versions requires for Jetson Device. If you are using a different device, you do not need to enter it.\n\n  | Software Version / Device | JETSON_NANO | JETSON_TX2 | JETSON_XAVIER | JETSON_NX | JETSON_AGX_ORIN | JETSON_ORIN_NANO |\n  |:--------------------------|:-----------:|:----------:|:-------------:|:---------:|:---------------:|:----------------:|\n  | JETPACK_4_4_1             |     ✔️      |            |               |           |                 |                  |\n  | JETPACK_4_6               |     ✔️      |     ✔️     |      ✔️       |    ✔️     |                 |                  |\n  | JETPACK_5_0_1             |             |            |               |           |       ✔️        |                  |\n  | JETPACK_5_0_2             |             |            |               |    ✔️     |                 |                  |\n  | JETPACK_6_0               |             |            |               |           |                 |        ✔️        |\n\n  The code below is an example of using software version.\n\n  ```python\n  conversion_result = converter.convert_model(\n      input_model_path=INPUT_MODEL_PATH,\n      output_dir=OUTPUT_DIR,\n      target_framework=Framework.TENSORRT,\n      target_device_name=DeviceName.JETSON_AGX_ORIN,\n      target_software_version=SoftwareVersion.JETPACK_5_0_1,\n  )\n  benchmark_result = benchmarker.benchmark_model(\n      input_model_path=CONVERTED_MODEL_PATH,\n      target_device_name=DeviceName.JETSON_AGX_ORIN,\n      target_software_version=SoftwareVersion.JETPACK_5_0_1,\n  )\n  ```\n\n  ### Hardware type that support benchmarks for specific devices\n\n  Benchmark and compare models with and without Arm Helium.\n\n  `RENESAS_RA8D1` and `ALIF_ENSEMBLE_E7_DEVKIT_GEN2` are available for use.\n\n  The benchmark results with Helium can be up to twice as fast as without Helium.\n\n  The code below is an example of using hardware type.\n\n  ```python\n  benchmark_result = benchmarker.benchmark_model(\n      input_model_path=CONVERTED_MODEL_PATH,\n      target_device_name=DeviceName.RENESAS_RA8D1,\n      target_data_type=DataType.INT8,\n      target_hardware_type=HardwareType.HELIUM\n  )\n  ```\n  \u003c/div\u003e\n\u003c/details\u003e\n\n\n## Guide to Credit Consumption by Module\n\n\u003ctable width=\"90%\"\u003e\n  \u003ctr\u003e\n      \u003cth\u003eModule\u003c/th\u003e\n      \u003cth\u003eFeature\u003c/th\u003e\n      \u003cth\u003eCredit\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n      \u003ctd align=\"center\" rowspan=\"2\"\u003eCompressor\u003c/td\u003e\n      \u003ctd align=\"center\"\u003eAutomatic compression\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e25\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n      \u003ctd align=\"center\"\u003eAdvanced compression\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e50\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n      \u003ctd align=\"center\"\u003eConverter\u003c/td\u003e\n      \u003ctd align=\"center\"\u003eConvert\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e50\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n      \u003ctd align=\"center\"\u003eBenchmarker\u003c/td\u003e\n      \u003ctd align=\"center\"\u003eBenchmark\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e25\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Contact\n\nJoin our [Discussion Forum] for providing feedback or sharing your use cases, and if you want to talk more with Nota, please contact us [here].\u003c/br\u003e\nOr you can also do it via email([netspresso@nota.ai]) or phone(+82 2-555-8659)!\n\n\n[Docs]: https://nota-netspresso.github.io/PyNetsPresso\n[Discussion Forum]: https://github.com/orgs/Nota-NetsPresso/discussions\n[NetsPresso]: https://netspresso.ai?utm_source=git_comp\u0026utm_medium=text_np\u0026utm_campaign=py_launch\n[NetsPresso-Sign-Up]: https://netspresso.ai/signup\n[here]: https://www.nota.ai/contact-us\n[netspresso@nota.ai]: mailto:netspresso@nota.ai\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnota-netspresso%2Fpynetspresso","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnota-netspresso%2Fpynetspresso","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnota-netspresso%2Fpynetspresso/lists"}