Whale viewer
This module provides a streamlit rendering for the whales and dolphins that the classifier is aware of, and also holds the metadata for them (images, class names that the classifier uses, and URLS for further information about each species).
display_whale(whale_classes, i, viewcontainer=None)
Display whale image and reference to the provided viewcontainer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
whale_classes
|
List[str]
|
A list of whale class names. |
required |
i
|
int
|
The index of the whale class to display. |
required |
viewcontainer
|
The container to display the whale information. If
not provided, use the current streamlit context (works via
'with |
None
|
Returns:
Type | Description |
---|---|
None |
TODO: how to find the object type of viewcontainer.? they are just "deltagenerators" but we want the result of the generator.. In any case, it works ok with either call signature.
Source code in src/whale_viewer.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
format_whale_name(whale_class)
Formats a whale class name for display
Parameters:
Name | Type | Description | Default |
---|---|---|---|
whale_class
|
str
|
The class name of the whale, with words separated by underscores. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The formatted whale name with spaces instead of underscores and each word capitalized. |
Source code in src/whale_viewer.py
106 107 108 109 110 111 112 113 114 115 116 117 |
|