Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1#!/usr/bin/env python
2# coding=utf-8
4"""DRHAGIS dataset for Vessel Segmentation
6The DR HAGIS database has been created to aid the development of vessel extraction algorithms
7suitable for retinal screening programmes. Researchers are encouraged to test their
8segmentation algorithms using this database.
10It should be noted that image 24 and 32 are identical, as this fundus image was obtained
11from a patient exhibiting both diabetic retinopathy and age-related macular degeneration.
14The images resolutions (height x width) are:
15 - 4752x3168 or
16 - 3456x2304 or
17 - 3126x2136 or
18 - 2896x1944 or
19 - 2816x1880 or
21* Protocol ``default``:
23 * Training samples: 19 (including labels and masks)
24 * Test samples: 20 (including labels and masks)
27"""
29import os
31import pkg_resources
33import bob.extension
35from ..dataset import JSONDataset
36from ..loader import load_pil_1, load_pil_rgb, make_delayed
38_protocols = [
39 pkg_resources.resource_filename(__name__, "default.json"),
40]
42_root_path = bob.extension.rc.get(
43 "bob.ip.binseg.drhagis.datadir", os.path.realpath(os.curdir)
44)
47def _raw_data_loader(sample):
48 return dict(
49 data=load_pil_rgb(os.path.join(_root_path, sample["data"])),
50 label=load_pil_1(os.path.join(_root_path, sample["label"])),
51 mask=load_pil_1(os.path.join(_root_path, sample["mask"])),
52 )
55def _loader(context, sample):
56 # "context" is ignored in this case - database is homogeneous
57 # we returned delayed samples to avoid loading all images at once
58 return make_delayed(sample, _raw_data_loader)
61dataset = JSONDataset(
62 protocols=_protocols,
63 fieldnames=("data", "label", "mask"),
64 loader=_loader,
65)
66"""DRHAGIS dataset object"""