def get_pytorch_faster_rcnn(get_pytorch_object_detector_data):
    """
    This class tests the PyTorchFasterRCNN object detector.
    """
    import torch

    from art.estimators.object_detection.pytorch_faster_rcnn import PyTorchFasterRCNN

    # Define object detector
    object_detector = PyTorchFasterRCNN(
        input_shape=(3, 416, 416),
        clip_values=(0, 1),
        channels_first=True,
        attack_losses=["loss_classifier", "loss_box_reg", "loss_objectness", "loss_rpn_box_reg"],
    )
    params = [p for p in object_detector.model.parameters() if p.requires_grad]
    optimizer = torch.optim.SGD(params, lr=0.01)

    object_detector.set_params(optimizer=optimizer)

    x_test, y_test = get_pytorch_object_detector_data

    yield object_detector, x_test, y_test

    This class tests the PyTorchFasterRCNN object detector.
    
tests/estimators/object_detection/conftest.py