File tree Expand file tree Collapse file tree 10 files changed +1035
-2
lines changed
art/estimators/object_detection
tests/estimators/object_detection Expand file tree Collapse file tree 10 files changed +1035
-2
lines changed Original file line number Diff line number Diff line change 1+ # Get base from a pytorch image
2+ FROM pytorch/pytorch:1.11.0-cuda11.3-cudnn8-runtime
3+
4+ # Set to install things in non-interactive mode
5+ ENV DEBIAN_FRONTEND noninteractive
6+
7+ # Install system wide software
8+ RUN apt-get update \
9+ && apt-get install -y \
10+ libgl1-mesa-glx \
11+ libx11-xcb1 \
12+ git \
13+ gcc \
14+ mono-mcs \
15+ cmake \
16+ libavcodec-extra \
17+ ffmpeg \
18+ curl \
19+ wget \
20+ && apt-get clean all \
21+ && rm -r /var/lib/apt/lists/*
22+
23+ RUN pip install six setuptools tqdm
24+ RUN pip install numpy==1.21.6 scipy==1.8.1 scikit-learn==1.1.1 numba==0.55.1
25+ RUN pip install torch==1.11.0
26+ RUN pip install tensorflow==2.9.1
27+ RUN pip install pytest-cov
28+
29+ # Install necessary libraries for Yolo v3
30+ RUN pip install pytorchyolo==1.6.2
31+
32+ RUN cd /tmp/ && git clone https://github.com/eriklindernoren/PyTorch-YOLOv3.git
33+ RUN cd PyTorch-YOLOv3/weights && ./download_weights.sh
Original file line number Diff line number Diff line change 1+ name : ' Test YOLO'
2+ description : ' Run tests for YOLO'
3+ runs :
4+ using : ' composite'
5+ steps :
6+ - run : $GITHUB_ACTION_PATH/run.sh
7+ shell : bash
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ exit_code=0
4+
5+ pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/object_detection/test_pytorch_yolo.py --framework=pytorch --durations=0
6+ if [[ $? -ne 0 ]]; then exit_code=1; echo " Failed estimators/speech_recognition/test_pytorch_yolo tests" ; fi
7+
8+ exit ${exit_code}
Original file line number Diff line number Diff line change 1+ name : CI PyTorchYolo
2+ on :
3+ # Run on manual trigger
4+ workflow_dispatch :
5+
6+ # Run on pull requests
7+ pull_request :
8+ paths-ignore :
9+ - ' *.md'
10+
11+ # Run when pushing to main or dev branches
12+ push :
13+ branches :
14+ - main
15+ - dev*
16+
17+ # Run scheduled CI flow daily
18+ schedule :
19+ - cron : ' 0 8 * * 0'
20+
21+ jobs :
22+ test_deepspeech_v3_torch_1_10 :
23+ name : PyTorchYolo
24+ runs-on : ubuntu-latest
25+ container : adversarialrobustnesstoolbox/art_testing_envs:yolo
26+ steps :
27+ - name : Checkout Repo
28+ uses : actions/checkout@v3
29+ - name : Run Test Action
30+ uses : ./.github/actions/yolo
31+ - name : Upload coverage to Codecov
32+ uses : codecov/codecov-action@v3
33+ with :
34+ fail_ci_if_error : true
Original file line number Diff line number Diff line change 55
66from art .estimators .object_detection .pytorch_object_detector import PyTorchObjectDetector
77from art .estimators .object_detection .pytorch_faster_rcnn import PyTorchFasterRCNN
8+ from art .estimators .object_detection .pytorch_yolo import PyTorchYolo
89from art .estimators .object_detection .tensorflow_faster_rcnn import TensorFlowFasterRCNN
Original file line number Diff line number Diff line change 3737
3838class PyTorchFasterRCNN (PyTorchObjectDetector ):
3939 """
40- This class implements a model-specific object detector using Faster-RCNN and PyTorch.
40+ This class implements a model-specific object detector using Faster-RCNN and PyTorch following the input and output
41+ formats of torchvision.
4142 """
4243
4344 def __init__ (
Original file line number Diff line number Diff line change 3939
4040class PyTorchObjectDetector (ObjectDetectorMixin , PyTorchEstimator ):
4141 """
42- This module implements the task specific estimator for PyTorch object detectors.
42+ This module implements the task specific estimator for PyTorch object detection models following the input and
43+ output formats of torchvision.
4344 """
4445
4546 estimator_params = PyTorchEstimator .estimator_params + ["attack_losses" ]
You can’t perform that action at this time.
0 commit comments