MegaDetector v5¶
MegaDetectorV5
¶
Bases: YOLOV5Base
MegaDetectorV5 is a specialized class derived from the YOLOV5Base class that is specifically designed for detecting animals, persons, and vehicles.
Attributes:
Name | Type | Description |
---|---|---|
IMAGE_SIZE |
int
|
The standard image size used during training. |
STRIDE |
int
|
Stride value used in the detector. |
CLASS_NAMES |
dict
|
Mapping of class IDs to their respective names. |
Source code in PytorchWildlife/models/detection/ultralytics_based/megadetectorv5.py
__init__(weights=None, device='cpu', pretrained=True, version='a')
¶
Initializes the MegaDetectorV5 model with the option to load pretrained weights.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
weights
|
str
|
Path to the weights file. |
None
|
device
|
str
|
Device to load the model on (e.g., "cpu" or "cuda"). Default is "cpu". |
'cpu'
|
pretrained
|
bool
|
Whether to load the pretrained model. Default is True. |
True
|
version
|
str
|
Version of the MegaDetectorV5 model to load. Default is "a". |
'a'
|