Repository: Lightning-Universe/lightning-flash

Issue:
Docs for using `output` with `ObjectDetector`
## 🐛 Bug

I'am trying to use FiftyOneDetectionLabelsOutput output for Object detection but i got the following error

model = model_type.model(backbone=backbone, num_classes=num_classes, **kwargs)
TypeError: model() got an unexpected keyword argument 'output'

How can i correctly setup the output?

### To Reproduce
from flash.image.detection.output import FiftyOneDetectionLabelsOutput
from flash.image import ObjectDetector

out= FiftyOneDetectionLabelsOutput(threshold=0.7)
objDetc=ObjectDetector(num_classes=81,backbone="medium",head="yolov5",output=out)


### Expected behavior
Class init correctly as described in documentation

https://lightning-flash.readthedocs.io/en/latest/api/generated/flash.image.detection.model.ObjectDetector.html#flash.image.detection.model.ObjectDetector
There is a parameter output in the description. Maybe is an old value


### Environment

 - OS (e.g., Linux): Linux
 - Python version: 3.8
 - PyTorch/Lightning/Flash Version (e.g., 1.10/1.5/0.7): 1.10 / 1.5.8 / 0.7.4
 - GPU models and configuration: cuda 11.3
 


Discussion:
Hi @eric-tc Thanks for reporting this! There seems to be some confusion as the `output` argument is to be passed to the `flash.Trainer.predict` method. For example, your code could look like this:
```python
model = ObjectDetector(num_classes=81, backbone="medium", head="yolov5")
trainer = flash.Trainer()
predictions = trainer.predict(model, datamodule=datamodule, output=FiftyOneDetectionLabelsOutput(threshold=0.7))
```

Could you let us know where in the docs this was incorrectly described? It sounds liike they could do with an update :smiley:

Thanks!
Hi @ethanwharris 

thanks for the response. At this link https://lightning-flash.readthedocs.io/en/latest/api/generated/flash.image.detection.model.ObjectDetector.html#flash.image.detection.model.ObjectDetector 
in parameter's section there is an output parameter

**output:**
– The [Output] to use when formatting prediction outputs.

![Lightning](https://user-images.githubusercontent.com/6271230/168831414-63c1f2fd-0212-4c30-a197-8b9e3c8e75b7.png)

I Attach the image 
Ah, thanks @eric-tc, looks like it just needs to be removed from the docstring here: https://github.com/PyTorchLightning/lightning-flash/blob/61e1a2d3b72f8fbbffe6ace14fb5b5bb35c5f131/flash/image/detection/model.py#L36

@eric-tc would you be interested in making a PR to contribute the fix?
Hi @ethanwharris,

yes I am interested. How I need to do the PR?  I need to follow this guidelines https://github.com/PyTorchLightning/lightning-flash/blob/master/.github/CONTRIBUTING.md Thanks

Resolving patch:
diff --git a/flash/image/detection/model.py b/flash/image/detection/model.py
--- a/flash/image/detection/model.py
+++ b/flash/image/detection/model.py
@@ -39,7 +39,6 @@ class ObjectDetector(AdapterTask):
         optimizer: Optimizer to use for training.
         lr_scheduler: The LR scheduler to use during training.
         learning_rate: The learning rate to use for training.
-        output: The :class:`~flash.core.data.io.output.Output` to use when formatting prediction outputs.
         predict_kwargs: dictionary containing parameters that will be used during the prediction phase.
         kwargs: additional kwargs nessesary for initializing the backbone task
     """


Test patch: