This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This file demonstrates how to | |
1. Download a project with DICOM series from Encord Annotate | |
2. Extract masks based on all the polygons and bounding boxes in the project | |
The only dependency is `encord-active`. | |
_Installation:_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This script will add tags in Encord Active based on nested radio attributes. | |
If an object has no nested attributes, it will be tagged with "no classification". | |
To run the script, make sure to have your encord active environment sourced and | |
then do: | |
```shell | |
(ea-venv)$ python tag_with_radio_classifications.py "/path/to/your/encord-active/project" | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
import numpy as np | |
from encord_active.lib.labels.label_transformer import ( | |
BoundingBox, | |
BoundingBoxLabel, | |
DataLabel, | |
LabelTransformer, | |
PolygonLabel, | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import perf_counter | |
import cv2 | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import torch | |
from kornia.utils import draw_convex_polygon | |
from torch import Tensor | |
OlderNewer