MCPcopy Create free account
hub / github.com/AIRMEC/HECTOR / __init__

Method __init__

extract_features.py:450–463  ·  view source on GitHub ↗
(self, wsi, tiles, resize_to=224)

Source from the content-addressed store, hash-verified

448
449class BagOfTiles(Dataset):
450 def __init__(self, wsi, tiles, resize_to=224):
451 self.wsi = wsi
452 self.tiles = tiles
453
454 self.roi_transforms = transforms.Compose(
455 [
456 # As we can't be sure that the input tile dimensions are all consistent, we resize
457 # them to a commonly used size before feeding them to the model.
458 # Note: assumes a square image.
459 transforms.Resize(resize_to),
460 # Turn the PIL image into a (C x H x W) float tensor in the range [0.0, 1.0]
461 transforms.ToTensor(),
462 ]
463 )
464
465 def __len__(self):
466 return len(self.tiles)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected