Skip to content

Commit bc6aa61

Browse files
authored
Merge pull request #1295 from Trusted-AI/development_issue_1196
Add general object detection estimator for PyTorch
2 parents 58839f7 + 173481f commit bc6aa61

File tree

9 files changed

+743
-332
lines changed

9 files changed

+743
-332
lines changed

.github/workflows/ci-pytorch-fasterrcnn.yml renamed to .github/workflows/ci-pytorch-object-detectors.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI PyTorchFasterRCNN
1+
name: CI PyTorchObjectDetectors
22
on:
33
# Run on manual trigger
44
workflow_dispatch:
@@ -20,7 +20,7 @@ on:
2020

2121
jobs:
2222
test_pytorch_fasterrcnn:
23-
name: PyTorchFasterRCNN
23+
name: PyTorchObjectDetectors
2424
runs-on: ubuntu-20.04
2525
strategy:
2626
fail-fast: false
@@ -43,7 +43,9 @@ jobs:
4343
pip install torch==1.6.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
4444
pip install torchvision==0.7.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
4545
pip install torchaudio==0.6.0 -f https://download.pytorch.org/whl/torch_stable.html
46-
- name: Run Test Action
46+
- name: Run Test Action - test_pytorch_object_detector
47+
run: pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/object_detection/test_pytorch_object_detector.py --framework=pytorch --durations=0
48+
- name: Run Test Action - test_pytorch_faster_rcnn
4749
run: pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/object_detection/test_pytorch_faster_rcnn.py --framework=pytorch --durations=0
4850
- name: Upload coverage to Codecov
4951
uses: codecov/[email protected]

art/attacks/evasion/projected_gradient_descent/projected_gradient_descent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
)
4646

4747
if TYPE_CHECKING:
48-
from art.utils import CLASSIFIER_LOSS_GRADIENTS_TYPE
48+
from art.utils import CLASSIFIER_LOSS_GRADIENTS_TYPE, OBJECT_DETECTOR_TYPE
4949

5050
logger = logging.getLogger(__name__)
5151

@@ -76,7 +76,7 @@ class ProjectedGradientDescent(EvasionAttack):
7676

7777
def __init__(
7878
self,
79-
estimator: "CLASSIFIER_LOSS_GRADIENTS_TYPE",
79+
estimator: Union["CLASSIFIER_LOSS_GRADIENTS_TYPE", "OBJECT_DETECTOR_TYPE"],
8080
norm: Union[int, float, str] = np.inf,
8181
eps: Union[int, float, np.ndarray] = 0.3,
8282
eps_step: Union[int, float, np.ndarray] = 0.1,

art/estimators/object_detection/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"""
44
from art.estimators.object_detection.object_detector import ObjectDetectorMixin
55

6+
from art.estimators.object_detection.python_object_detector import PyTorchObjectDetector
67
from art.estimators.object_detection.pytorch_faster_rcnn import PyTorchFasterRCNN
78
from art.estimators.object_detection.tensorflow_faster_rcnn import TensorFlowFasterRCNN

0 commit comments

Comments
 (0)