Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -25,35 +25,7 @@ Lineage: EfficientNetV2 -> miewid-msv3 -> miewid-msv3-latonia-1233.
|
|
| 25 |
Images are preprocessed as described in the preprint:
|
| 26 |
- Rotate images so the head is oriented upwards.
|
| 27 |
- Detect a bounding box using MegaDetector and crop to the bbox.
|
| 28 |
-
- Apply the
|
| 29 |
-
|
| 30 |
-
```python
|
| 31 |
-
from torchvision import transforms
|
| 32 |
-
|
| 33 |
-
preprocess = transforms.Compose([
|
| 34 |
-
ZoomCenterCrop(zoom=2.0),
|
| 35 |
-
transforms.Resize((440, 440)),
|
| 36 |
-
transforms.ToTensor(),
|
| 37 |
-
transforms.Normalize(
|
| 38 |
-
mean=[0.485, 0.456, 0.406],
|
| 39 |
-
std=[0.229, 0.224, 0.225]),
|
| 40 |
-
])
|
| 41 |
-
```
|
| 42 |
-
|
| 43 |
-
`ZoomCenterCrop` implementation:
|
| 44 |
-
|
| 45 |
-
```python
|
| 46 |
-
class ZoomCenterCrop:
|
| 47 |
-
def __init__(self, zoom=1.0):
|
| 48 |
-
self.zoom = zoom
|
| 49 |
-
|
| 50 |
-
def __call__(self, img):
|
| 51 |
-
w, h = img.size
|
| 52 |
-
m = int(min(h, w) / self.zoom)
|
| 53 |
-
left = (w - m) // 2
|
| 54 |
-
top = (h - m) // 2
|
| 55 |
-
return img.crop((left, top, left + m, top + m))
|
| 56 |
-
```
|
| 57 |
|
| 58 |
## Training
|
| 59 |
See the preprint for full training details and evaluation protocol.
|
|
|
|
| 25 |
Images are preprocessed as described in the preprint:
|
| 26 |
- Rotate images so the head is oriented upwards.
|
| 27 |
- Detect a bounding box using MegaDetector and crop to the bbox.
|
| 28 |
+
- Apply the transforms shown in the Usage example below.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
## Training
|
| 31 |
See the preprint for full training details and evaluation protocol.
|