📦 Installation
Install the package via pip:
pip install adversarialpytorchattack
## 📦 Or installation using Github
Or install from source
```sh
git clone https://github.com/santhoshatwork17@gmail.com/adversarialpytorchattackers.git
cd adversarial_pytorch_attack
## 🛠️ Usage
```python
import torch
import torchvision.models as models
from adversarialpytorchattack.attacks import FGSM, PGD, CW
from adversarialpytorchattack.utils import visualize_perturbation, save_image
# pre-trained model
model = models.resnet18(pretrained=True).eval()
# input image
image = torch.rand((1, 3, 224, 224)) # Example input
label = torch.tensor([0]) # Example label
# Apply attack
fgsm_attack = FGSM(model, epsilon=0.03)
adv_image = fgsm_attack(image, label)
# Save the adversarial image
save_image(adv_image, "adv_fgsm.jpg")
Metadata
Release files for adversarialtorchattacks 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| adversarialtorchattacks-1.0.0.tar.gz | 5.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| adversarialtorchattacks-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.1 kB
Release files / adversarialtorchattacks-1.0.0.tar.gz
| Download URL | adversarialtorchattacks-1.0.0.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d374b7bbd791db1de5ab4ca6af7c11a61087725c0fca817cd55f053072da6f61
|
|
BLAKE2b-256 checksum How to use checksums |
b14912aaa8b8f456490497a0a8d8b5bc980c0ab90c9ce1e2bcb6988306f3965b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.4
|
Release files / adversarialtorchattacks-1.0.0-py3-none-any.whl
| Download URL | adversarialtorchattacks-1.0.0-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fda17b8d1dc052fe212802a297beca883cb43c1b7cf2ccaea5a29f3edb1f72e8
|
|
BLAKE2b-256 checksum How to use checksums |
2b2dbc48ffe573e04cc010da174709d029a849002fe8a950589eea1b91a21123
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.4
|
Security for adversarialtorchattacks 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.