Skip to content

edspdf.visualization.annotations

show_annotations

Show Box annotations on a PDF document.

PARAMETER DESCRIPTION
pdf

Bytes content of the PDF document

TYPE: bytes

annotations

List of Box annotations to show

TYPE: Sequence[Box]

colors

Colors to use for each label. If a list is provided, it will be used to color the first len(colors) unique labels. If a dictionary is provided, it will be used to color the labels in the dictionary. If None, a default color scheme will be used.

TYPE: Optional[Union[Dict[str, str], List[str]]] DEFAULT: None

RETURNS DESCRIPTION
List[PpmImageFile]

List of PIL images with the annotations. You can display them in a notebook with display(*pages).

compare_results

Compare two sets of annotations on a PDF document.

PARAMETER DESCRIPTION
pdf

Bytes content of the PDF document

TYPE: bytes

pred

List of Box annotations to show on the left side

TYPE: Sequence[Box]

gold

List of Box annotations to show on the right side

TYPE: Sequence[Box]

colors

Colors to use for each label. If a list is provided, it will be used to color the first len(colors) unique labels. If a dictionary is provided, it will be used to color the labels in the dictionary. If None, a default color scheme will be used.

TYPE: Optional[Union[Dict[str, str], List[str]]] DEFAULT: None

RETURNS DESCRIPTION
List[PpmImageFile]

List of PIL images with the annotations. You can display them in a notebook with display(*pages).