Name | ultralytics-thop JSON |
Version |
2.0.15
JSON |
| download |
home_page | None |
Summary | Ultralytics THOP package for fast computation of PyTorch model FLOPs and parameters. |
upload_time | 2025-08-04 07:51:37 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | AGPL-3.0 |
keywords |
flops
pytorch
model analysis
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<a href="https://www.ultralytics.com/"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg" width="320" alt="Ultralytics logo"></a>
# 🚀 THOP: PyTorch-OpCounter
Welcome to the [THOP](https://github.com/ultralytics/thop) repository, your comprehensive solution for profiling [PyTorch](https://pytorch.org/) models by computing the number of Multiply-Accumulate Operations (MACs) and parameters. Developed by Ultralytics, this tool is essential for [deep learning](https://www.ultralytics.com/glossary/deep-learning-dl) practitioners aiming to evaluate model efficiency and performance, crucial aspects discussed in our [model training tips guide](https://docs.ultralytics.com/guides/model-training-tips/).
[](https://github.com/ultralytics/thop/actions/workflows/format.yml)
[](https://discord.com/invite/ultralytics)
[](https://community.ultralytics.com/)
[](https://reddit.com/r/ultralytics)
## 📄 Description
THOP offers an intuitive API designed to profile PyTorch models by calculating the total number of MACs and parameters. This functionality is vital for assessing the computational efficiency and memory footprint of deep learning models, helping developers optimize performance for deployment, especially on [edge devices](https://www.ultralytics.com/glossary/edge-ai). Understanding these metrics is key to selecting the right model architecture, a topic explored in our [model comparison pages](https://docs.ultralytics.com/compare/).
## 📦 Installation
Get started with THOP quickly by installing it via pip:
[](https://pypi.org/project/ultralytics-thop/) [](https://www.pepy.tech/projects/ultralytics-thop) [](https://pypi.org/project/ultralytics-thop/)
```bash
pip install ultralytics-thop
```
Alternatively, for the latest features and updates, install directly from the GitHub repository:
```bash
pip install --upgrade git+https://github.com/ultralytics/thop.git
```
This ensures you have the most recent version, incorporating the latest improvements and bug fixes.
## 🛠️ How to Use
### Basic Usage
Profiling a standard PyTorch model like [ResNet50](https://pytorch.org/vision/main/models/generated/torchvision.models.resnet50.html) is straightforward. Import the necessary libraries, load your model and a sample input tensor, then use the `profile` function:
```python
import torch
from torchvision.models import resnet50 # Example model
from thop import profile # Import the profile function from THOP
# Load a pre-trained model (e.g., ResNet50)
model = resnet50()
# Create a dummy input tensor matching the model's expected input shape
dummy_input = torch.randn(1, 3, 224, 224)
# Profile the model
macs, params = profile(model, inputs=(dummy_input,))
print(f"MACs: {macs}, Parameters: {params}")
# Expected output: MACs: 4139975680.0, Parameters: 25557032.0
```
### Define Custom Rules for Third-Party Modules
If your model includes custom or third-party modules not natively supported by THOP, you can define custom profiling rules using the `custom_ops` argument. This allows for accurate profiling even with complex or non-standard architectures, which is useful when working with models like those found in the [Ultralytics models section](https://docs.ultralytics.com/models/).
```python
import torch
import torch.nn as nn
from thop import profile
# Define your custom module
class YourCustomModule(nn.Module):
def __init__(self):
super().__init__()
# Define layers, e.g., a convolution
self.conv = nn.Conv2d(3, 64, kernel_size=3, stride=1, padding=1)
def forward(self, x):
return self.conv(x)
# Define a custom counting function for your module
# This function should calculate and return the MACs for the module's operations
def count_your_custom_module(module, x, y):
# Example: Calculate MACs for the conv layer
# Note: This is a simplified example. Real calculations depend on the module's specifics.
# MACs = output_height * output_width * kernel_height * kernel_width * in_channels * out_channels
# For simplicity, we'll just assign a placeholder value or use a helper if available
# In a real scenario, you'd implement the precise MAC calculation here.
# For nn.Conv2d, THOP usually handles it, but this demonstrates the concept.
macs = 0 # Placeholder: Implement actual MAC calculation based on module logic
# You might need access to module properties like kernel_size, stride, padding, channels etc.
# Example for a Conv2d layer (simplified):
if isinstance(module, nn.Conv2d):
_, _, H, W = y.shape # Output shape
k_h, k_w = module.kernel_size
in_c = module.in_channels
out_c = module.out_channels
groups = module.groups
macs = (k_h * k_w * in_c * out_c * H * W) / groups
module.total_ops += torch.DoubleTensor([macs]) # Accumulate MACs
# Instantiate a model containing your custom module
model = YourCustomModule() # Or a larger model incorporating this module
# Create a dummy input
dummy_input = torch.randn(1, 3, 224, 224)
# Profile the model, providing the custom operation mapping
macs, params = profile(model, inputs=(dummy_input,), custom_ops={YourCustomModule: count_your_custom_module})
print(f"Custom MACs: {macs}, Parameters: {params}")
# Expected output: Custom MACs: 87457792.0, Parameters: 1792.0
```
### Improve Output Readability
For clearer and more interpretable results, use the `thop.clever_format` function. This formats the raw MACs and parameter counts into human-readable strings (e.g., GigaMACs, MegaParams). This formatting helps in quickly understanding the scale of computational resources required, similar to the metrics provided in our [Ultralytics YOLOv8 documentation](https://docs.ultralytics.com/models/yolov8/).
```python
import torch
from torchvision.models import resnet50
from thop import clever_format, profile
model = resnet50()
dummy_input = torch.randn(1, 3, 224, 224)
macs, params = profile(model, inputs=(dummy_input,))
# Format the numbers into a readable format (e.g., 4.14 GMac, 25.56 MParams)
macs_readable, params_readable = clever_format([macs, params], "%.3f")
print(f"Formatted MACs: {macs_readable}, Formatted Parameters: {params_readable}")
# Expected output: Formatted MACs: 4.140G, Formatted Parameters: 25.557M
```
## 📊 Results of Recent Models
The table below showcases the parameters and MACs for several popular [computer vision](https://www.ultralytics.com/glossary/computer-vision-cv) models, profiled using THOP. These benchmarks provide a comparative overview of model complexity and computational cost. You can reproduce these results by running the script located at `benchmark/evaluate_famous_models.py` in this repository. Comparing these metrics is essential for tasks like selecting models for [object detection](https://www.ultralytics.com/glossary/object-detection) or [image classification](https://www.ultralytics.com/glossary/image-classification). For more comparisons, see our [model comparison section](https://docs.ultralytics.com/compare/).
<table align="center">
<tr>
<td>
| Model | Params(M) | MACs(G) |
| ---------------- | --------- | ------- |
| alexnet | 61.10 | 0.77 |
| vgg11 | 132.86 | 7.74 |
| vgg11_bn | 132.87 | 7.77 |
| vgg13 | 133.05 | 11.44 |
| vgg13_bn | 133.05 | 11.49 |
| vgg16 | 138.36 | 15.61 |
| vgg16_bn | 138.37 | 15.66 |
| vgg19 | 143.67 | 19.77 |
| vgg19_bn | 143.68 | 19.83 |
| resnet18 | 11.69 | 1.82 |
| resnet34 | 21.80 | 3.68 |
| resnet50 | 25.56 | 4.14 |
| resnet101 | 44.55 | 7.87 |
| resnet152 | 60.19 | 11.61 |
| wide_resnet101_2 | 126.89 | 22.84 |
| wide_resnet50_2 | 68.88 | 11.46 |
</td>
<td>
| Model | Params(M) | MACs(G) |
| ------------------ | --------- | ------- |
| resnext50_32x4d | 25.03 | 4.29 |
| resnext101_32x8d | 88.79 | 16.54 |
| densenet121 | 7.98 | 2.90 |
| densenet161 | 28.68 | 7.85 |
| densenet169 | 14.15 | 3.44 |
| densenet201 | 20.01 | 4.39 |
| squeezenet1_0 | 1.25 | 0.82 |
| squeezenet1_1 | 1.24 | 0.35 |
| mnasnet0_5 | 2.22 | 0.14 |
| mnasnet0_75 | 3.17 | 0.24 |
| mnasnet1_0 | 4.38 | 0.34 |
| mnasnet1_3 | 6.28 | 0.53 |
| mobilenet_v2 | 3.50 | 0.33 |
| shufflenet_v2_x0_5 | 1.37 | 0.05 |
| shufflenet_v2_x1_0 | 2.28 | 0.15 |
| shufflenet_v2_x1_5 | 3.50 | 0.31 |
| shufflenet_v2_x2_0 | 7.39 | 0.60 |
| inception_v3 | 27.16 | 5.75 |
</td>
</tr>
</table>
## 🙌 Contribute
We actively welcome and encourage community contributions to make THOP even better! Whether it's adding support for new [PyTorch layers](https://pytorch.org/docs/stable/nn.html), improving existing calculations, enhancing documentation, or fixing bugs, your input is valuable. Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing/) for detailed instructions on how to participate. Together, we can ensure THOP remains a state-of-the-art tool for the [machine learning](https://www.ultralytics.com/glossary/machine-learning-ml) community. Don't hesitate to share your feedback and suggestions!
## 📜 License
THOP is distributed under the [AGPL-3.0 License](https://www.gnu.org/licenses/agpl-3.0.en.html). This license promotes open collaboration and sharing of improvements. For complete details, please refer to the [LICENSE](https://github.com/ultralytics/thop/blob/main/LICENSE) file included in the repository. Understanding the license is important before integrating THOP into your projects, especially for commercial applications which may require an [Enterprise License](https://www.ultralytics.com/license).
## 📧 Contact
Encountered a bug or have a feature request? Please submit an issue through our [GitHub Issues](https://github.com/ultralytics/thop/issues) page. For general discussions, questions, and community support, join the vibrant Ultralytics community on our [Discord server](https://discord.com/invite/ultralytics). We look forward to hearing from you and collaborating!
<br>
<div align="center">
<a href="https://github.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-github.png" width="3%" alt="Ultralytics GitHub"></a>
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
<a href="https://www.linkedin.com/company/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-linkedin.png" width="3%" alt="Ultralytics LinkedIn"></a>
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
<a href="https://twitter.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-twitter.png" width="3%" alt="Ultralytics Twitter"></a>
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
<a href="https://youtube.com/ultralytics?sub_confirmation=1"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-youtube.png" width="3%" alt="Ultralytics YouTube"></a>
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
<a href="https://www.tiktok.com/@ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-tiktok.png" width="3%" alt="Ultralytics TikTok"></a>
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
<a href="https://ultralytics.com/bilibili"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-bilibili.png" width="3%" alt="Ultralytics BiliBili"></a>
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
<a href="https://discord.com/invite/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png" width="3%" alt="Ultralytics Discord"></a>
</div>
Raw data
{
"_id": null,
"home_page": null,
"name": "ultralytics-thop",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Ultralytics <hello@ultralytics.com>",
"keywords": "FLOPs, PyTorch, Model Analysis",
"author": null,
"author_email": "Ligeng Zhu <ligeng.zhu+github@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/e3/1e/cb9e0f59788a93a733b1f9ff182201db2b5bd036303b5b4f423743100b81/ultralytics_thop-2.0.15.tar.gz",
"platform": null,
"description": "<a href=\"https://www.ultralytics.com/\"><img src=\"https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg\" width=\"320\" alt=\"Ultralytics logo\"></a>\n\n# \ud83d\ude80 THOP: PyTorch-OpCounter\n\nWelcome to the [THOP](https://github.com/ultralytics/thop) repository, your comprehensive solution for profiling [PyTorch](https://pytorch.org/) models by computing the number of Multiply-Accumulate Operations (MACs) and parameters. Developed by Ultralytics, this tool is essential for [deep learning](https://www.ultralytics.com/glossary/deep-learning-dl) practitioners aiming to evaluate model efficiency and performance, crucial aspects discussed in our [model training tips guide](https://docs.ultralytics.com/guides/model-training-tips/).\n\n[](https://github.com/ultralytics/thop/actions/workflows/format.yml)\n[](https://discord.com/invite/ultralytics)\n[](https://community.ultralytics.com/)\n[](https://reddit.com/r/ultralytics)\n\n## \ud83d\udcc4 Description\n\nTHOP offers an intuitive API designed to profile PyTorch models by calculating the total number of MACs and parameters. This functionality is vital for assessing the computational efficiency and memory footprint of deep learning models, helping developers optimize performance for deployment, especially on [edge devices](https://www.ultralytics.com/glossary/edge-ai). Understanding these metrics is key to selecting the right model architecture, a topic explored in our [model comparison pages](https://docs.ultralytics.com/compare/).\n\n## \ud83d\udce6 Installation\n\nGet started with THOP quickly by installing it via pip:\n\n[](https://pypi.org/project/ultralytics-thop/) [](https://www.pepy.tech/projects/ultralytics-thop) [](https://pypi.org/project/ultralytics-thop/)\n\n```bash\npip install ultralytics-thop\n```\n\nAlternatively, for the latest features and updates, install directly from the GitHub repository:\n\n```bash\npip install --upgrade git+https://github.com/ultralytics/thop.git\n```\n\nThis ensures you have the most recent version, incorporating the latest improvements and bug fixes.\n\n## \ud83d\udee0\ufe0f How to Use\n\n### Basic Usage\n\nProfiling a standard PyTorch model like [ResNet50](https://pytorch.org/vision/main/models/generated/torchvision.models.resnet50.html) is straightforward. Import the necessary libraries, load your model and a sample input tensor, then use the `profile` function:\n\n```python\nimport torch\nfrom torchvision.models import resnet50 # Example model\n\nfrom thop import profile # Import the profile function from THOP\n\n# Load a pre-trained model (e.g., ResNet50)\nmodel = resnet50()\n\n# Create a dummy input tensor matching the model's expected input shape\ndummy_input = torch.randn(1, 3, 224, 224)\n\n# Profile the model\nmacs, params = profile(model, inputs=(dummy_input,))\n\nprint(f\"MACs: {macs}, Parameters: {params}\")\n# Expected output: MACs: 4139975680.0, Parameters: 25557032.0\n```\n\n### Define Custom Rules for Third-Party Modules\n\nIf your model includes custom or third-party modules not natively supported by THOP, you can define custom profiling rules using the `custom_ops` argument. This allows for accurate profiling even with complex or non-standard architectures, which is useful when working with models like those found in the [Ultralytics models section](https://docs.ultralytics.com/models/).\n\n```python\nimport torch\nimport torch.nn as nn\n\nfrom thop import profile\n\n\n# Define your custom module\nclass YourCustomModule(nn.Module):\n def __init__(self):\n super().__init__()\n # Define layers, e.g., a convolution\n self.conv = nn.Conv2d(3, 64, kernel_size=3, stride=1, padding=1)\n\n def forward(self, x):\n return self.conv(x)\n\n\n# Define a custom counting function for your module\n# This function should calculate and return the MACs for the module's operations\ndef count_your_custom_module(module, x, y):\n # Example: Calculate MACs for the conv layer\n # Note: This is a simplified example. Real calculations depend on the module's specifics.\n # MACs = output_height * output_width * kernel_height * kernel_width * in_channels * out_channels\n # For simplicity, we'll just assign a placeholder value or use a helper if available\n # In a real scenario, you'd implement the precise MAC calculation here.\n # For nn.Conv2d, THOP usually handles it, but this demonstrates the concept.\n macs = 0 # Placeholder: Implement actual MAC calculation based on module logic\n # You might need access to module properties like kernel_size, stride, padding, channels etc.\n # Example for a Conv2d layer (simplified):\n if isinstance(module, nn.Conv2d):\n _, _, H, W = y.shape # Output shape\n k_h, k_w = module.kernel_size\n in_c = module.in_channels\n out_c = module.out_channels\n groups = module.groups\n macs = (k_h * k_w * in_c * out_c * H * W) / groups\n module.total_ops += torch.DoubleTensor([macs]) # Accumulate MACs\n\n\n# Instantiate a model containing your custom module\nmodel = YourCustomModule() # Or a larger model incorporating this module\n\n# Create a dummy input\ndummy_input = torch.randn(1, 3, 224, 224)\n\n# Profile the model, providing the custom operation mapping\nmacs, params = profile(model, inputs=(dummy_input,), custom_ops={YourCustomModule: count_your_custom_module})\n\nprint(f\"Custom MACs: {macs}, Parameters: {params}\")\n# Expected output: Custom MACs: 87457792.0, Parameters: 1792.0\n```\n\n### Improve Output Readability\n\nFor clearer and more interpretable results, use the `thop.clever_format` function. This formats the raw MACs and parameter counts into human-readable strings (e.g., GigaMACs, MegaParams). This formatting helps in quickly understanding the scale of computational resources required, similar to the metrics provided in our [Ultralytics YOLOv8 documentation](https://docs.ultralytics.com/models/yolov8/).\n\n```python\nimport torch\nfrom torchvision.models import resnet50\n\nfrom thop import clever_format, profile\n\nmodel = resnet50()\ndummy_input = torch.randn(1, 3, 224, 224)\nmacs, params = profile(model, inputs=(dummy_input,))\n\n# Format the numbers into a readable format (e.g., 4.14 GMac, 25.56 MParams)\nmacs_readable, params_readable = clever_format([macs, params], \"%.3f\")\n\nprint(f\"Formatted MACs: {macs_readable}, Formatted Parameters: {params_readable}\")\n# Expected output: Formatted MACs: 4.140G, Formatted Parameters: 25.557M\n```\n\n## \ud83d\udcca Results of Recent Models\n\nThe table below showcases the parameters and MACs for several popular [computer vision](https://www.ultralytics.com/glossary/computer-vision-cv) models, profiled using THOP. These benchmarks provide a comparative overview of model complexity and computational cost. You can reproduce these results by running the script located at `benchmark/evaluate_famous_models.py` in this repository. Comparing these metrics is essential for tasks like selecting models for [object detection](https://www.ultralytics.com/glossary/object-detection) or [image classification](https://www.ultralytics.com/glossary/image-classification). For more comparisons, see our [model comparison section](https://docs.ultralytics.com/compare/).\n\n<table align=\"center\">\n<tr>\n<td>\n\n| Model | Params(M) | MACs(G) |\n| ---------------- | --------- | ------- |\n| alexnet | 61.10 | 0.77 |\n| vgg11 | 132.86 | 7.74 |\n| vgg11_bn | 132.87 | 7.77 |\n| vgg13 | 133.05 | 11.44 |\n| vgg13_bn | 133.05 | 11.49 |\n| vgg16 | 138.36 | 15.61 |\n| vgg16_bn | 138.37 | 15.66 |\n| vgg19 | 143.67 | 19.77 |\n| vgg19_bn | 143.68 | 19.83 |\n| resnet18 | 11.69 | 1.82 |\n| resnet34 | 21.80 | 3.68 |\n| resnet50 | 25.56 | 4.14 |\n| resnet101 | 44.55 | 7.87 |\n| resnet152 | 60.19 | 11.61 |\n| wide_resnet101_2 | 126.89 | 22.84 |\n| wide_resnet50_2 | 68.88 | 11.46 |\n\n</td>\n<td>\n\n| Model | Params(M) | MACs(G) |\n| ------------------ | --------- | ------- |\n| resnext50_32x4d | 25.03 | 4.29 |\n| resnext101_32x8d | 88.79 | 16.54 |\n| densenet121 | 7.98 | 2.90 |\n| densenet161 | 28.68 | 7.85 |\n| densenet169 | 14.15 | 3.44 |\n| densenet201 | 20.01 | 4.39 |\n| squeezenet1_0 | 1.25 | 0.82 |\n| squeezenet1_1 | 1.24 | 0.35 |\n| mnasnet0_5 | 2.22 | 0.14 |\n| mnasnet0_75 | 3.17 | 0.24 |\n| mnasnet1_0 | 4.38 | 0.34 |\n| mnasnet1_3 | 6.28 | 0.53 |\n| mobilenet_v2 | 3.50 | 0.33 |\n| shufflenet_v2_x0_5 | 1.37 | 0.05 |\n| shufflenet_v2_x1_0 | 2.28 | 0.15 |\n| shufflenet_v2_x1_5 | 3.50 | 0.31 |\n| shufflenet_v2_x2_0 | 7.39 | 0.60 |\n| inception_v3 | 27.16 | 5.75 |\n\n</td>\n</tr>\n</table>\n\n## \ud83d\ude4c Contribute\n\nWe actively welcome and encourage community contributions to make THOP even better! Whether it's adding support for new [PyTorch layers](https://pytorch.org/docs/stable/nn.html), improving existing calculations, enhancing documentation, or fixing bugs, your input is valuable. Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing/) for detailed instructions on how to participate. Together, we can ensure THOP remains a state-of-the-art tool for the [machine learning](https://www.ultralytics.com/glossary/machine-learning-ml) community. Don't hesitate to share your feedback and suggestions!\n\n## \ud83d\udcdc License\n\nTHOP is distributed under the [AGPL-3.0 License](https://www.gnu.org/licenses/agpl-3.0.en.html). This license promotes open collaboration and sharing of improvements. For complete details, please refer to the [LICENSE](https://github.com/ultralytics/thop/blob/main/LICENSE) file included in the repository. Understanding the license is important before integrating THOP into your projects, especially for commercial applications which may require an [Enterprise License](https://www.ultralytics.com/license).\n\n## \ud83d\udce7 Contact\n\nEncountered a bug or have a feature request? Please submit an issue through our [GitHub Issues](https://github.com/ultralytics/thop/issues) page. For general discussions, questions, and community support, join the vibrant Ultralytics community on our [Discord server](https://discord.com/invite/ultralytics). We look forward to hearing from you and collaborating!\n\n<br>\n<div align=\"center\">\n <a href=\"https://github.com/ultralytics\"><img src=\"https://github.com/ultralytics/assets/raw/main/social/logo-social-github.png\" width=\"3%\" alt=\"Ultralytics GitHub\"></a>\n <img src=\"https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png\" width=\"3%\" alt=\"space\">\n <a href=\"https://www.linkedin.com/company/ultralytics/\"><img src=\"https://github.com/ultralytics/assets/raw/main/social/logo-social-linkedin.png\" width=\"3%\" alt=\"Ultralytics LinkedIn\"></a>\n <img src=\"https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png\" width=\"3%\" alt=\"space\">\n <a href=\"https://twitter.com/ultralytics\"><img src=\"https://github.com/ultralytics/assets/raw/main/social/logo-social-twitter.png\" width=\"3%\" alt=\"Ultralytics Twitter\"></a>\n <img src=\"https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png\" width=\"3%\" alt=\"space\">\n <a href=\"https://youtube.com/ultralytics?sub_confirmation=1\"><img src=\"https://github.com/ultralytics/assets/raw/main/social/logo-social-youtube.png\" width=\"3%\" alt=\"Ultralytics YouTube\"></a>\n <img src=\"https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png\" width=\"3%\" alt=\"space\">\n <a href=\"https://www.tiktok.com/@ultralytics\"><img src=\"https://github.com/ultralytics/assets/raw/main/social/logo-social-tiktok.png\" width=\"3%\" alt=\"Ultralytics TikTok\"></a>\n <img src=\"https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png\" width=\"3%\" alt=\"space\">\n <a href=\"https://ultralytics.com/bilibili\"><img src=\"https://github.com/ultralytics/assets/raw/main/social/logo-social-bilibili.png\" width=\"3%\" alt=\"Ultralytics BiliBili\"></a>\n <img src=\"https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png\" width=\"3%\" alt=\"space\">\n <a href=\"https://discord.com/invite/ultralytics\"><img src=\"https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png\" width=\"3%\" alt=\"Ultralytics Discord\"></a>\n</div>\n",
"bugtrack_url": null,
"license": "AGPL-3.0",
"summary": "Ultralytics THOP package for fast computation of PyTorch model FLOPs and parameters.",
"version": "2.0.15",
"project_urls": {
"Bug Reports": "https://github.com/ultralytics/thop/issues",
"Changelog": "https://github.com/ultralytics/thop/releases",
"Documentation": "https://docs.ultralytics.com",
"Homepage": "https://ultralytics.com",
"Source": "https://github.com/ultralytics/thop"
},
"split_keywords": [
"flops",
" pytorch",
" model analysis"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "019b155181b98afe9f97e12bd1a7194778c77f3781450c57d6d18a07a878da19",
"md5": "b50ef5e782cf7a7f579b495cec66c9fb",
"sha256": "d643e074754c154a4cb8e97190f00ce57c999b8b6e756d780d730dc3a1e51ef6"
},
"downloads": -1,
"filename": "ultralytics_thop-2.0.15-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b50ef5e782cf7a7f579b495cec66c9fb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 28657,
"upload_time": "2025-08-04T07:51:36",
"upload_time_iso_8601": "2025-08-04T07:51:36.434135Z",
"url": "https://files.pythonhosted.org/packages/01/9b/155181b98afe9f97e12bd1a7194778c77f3781450c57d6d18a07a878da19/ultralytics_thop-2.0.15-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "e31ecb9e0f59788a93a733b1f9ff182201db2b5bd036303b5b4f423743100b81",
"md5": "4ea9a22613a6c2fc7fe6d23e81722ef7",
"sha256": "1bcf05dc0172045ce3da289f9125b36f999f5225596cb69fe12e09e139896e41"
},
"downloads": -1,
"filename": "ultralytics_thop-2.0.15.tar.gz",
"has_sig": false,
"md5_digest": "4ea9a22613a6c2fc7fe6d23e81722ef7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 33036,
"upload_time": "2025-08-04T07:51:37",
"upload_time_iso_8601": "2025-08-04T07:51:37.940889Z",
"url": "https://files.pythonhosted.org/packages/e3/1e/cb9e0f59788a93a733b1f9ff182201db2b5bd036303b5b4f423743100b81/ultralytics_thop-2.0.15.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-04 07:51:37",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ultralytics",
"github_project": "thop",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "ultralytics-thop"
}