forked from pasqualedem/LabelAnything
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
24 lines (18 loc) · 650 Bytes
/
test.py
File metadata and controls
24 lines (18 loc) · 650 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from label_anything.data.weedmap import WeedMapTestDataset
from label_anything.data.transforms import CustomResize, CustomNormalize
from torchvision.transforms import Compose, PILToTensor
import numpy as np
import lovely_tensors as lt
lt.monkey_patch()
preprocess = Compose([
CustomResize(1024),
PILToTensor(),
CustomNormalize()
])
weed = WeedMapTestDataset(
train_root="/ext/stalla/LabelAnything/WeedMap/0_rotations_processed_003_test/RedEdge/000",
test_root="/ext/stalla/LabelAnything/WeedMap/0_rotations_processed_003_test/RedEdge/003",
transform=preprocess,
)
print(weed.extract_prompts())
print(weed.__getitem__(0))