-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
4,283 additions
and
2,967 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
name: CI | ||
|
||
on: | ||
- push | ||
- pull_request | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: "0 10 * * *" | ||
|
||
jobs: | ||
linters_python: | ||
|
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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
def image_id_to_dataset_id(image_id: str): | ||
return image_id.split("_")[-1] | ||
|
||
|
||
def dataset_id_to_image_id(dataset_id: str): | ||
return f"img_{dataset_id}" | ||
|
||
|
||
def dataset_id_to_transformed_image_id(dataset_id: str): | ||
return f"transformed_img_{dataset_id}" | ||
|
||
|
||
def image_id_to_result_id(image_id: str): | ||
return f"result_{image_id}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from typing import TypedDict | ||
from nrtk_explorer.app.trame_utils import delete_state | ||
|
||
ImageMetaId = str | ||
|
||
|
||
def image_id_to_meta(image_id: str) -> ImageMetaId: | ||
return f"meta_{image_id}" | ||
|
||
|
||
class DatasetImageMeta(TypedDict): | ||
original_ground_to_original_detection_score: float | ||
original_detection_to_transformed_detection_score: float | ||
ground_truth_to_transformed_detection_score: float | ||
|
||
|
||
PartialDatasetImageMeta = TypedDict( | ||
"PartialDatasetImageMeta", {**DatasetImageMeta.__annotations__}, total=False | ||
) | ||
|
||
IMAGE_META_DEFAULTS: DatasetImageMeta = { | ||
"original_ground_to_original_detection_score": 0, | ||
"original_detection_to_transformed_detection_score": 0, | ||
"ground_truth_to_transformed_detection_score": 0, | ||
} | ||
|
||
|
||
def update_image_meta(state, dataset_id: str, meta_patch: PartialDatasetImageMeta): | ||
meta_key = image_id_to_meta(dataset_id) | ||
current_meta = {} | ||
if state.has(meta_key) and state[meta_key] is not None: | ||
current_meta = state[meta_key] | ||
state[meta_key] = {**IMAGE_META_DEFAULTS, **current_meta, **meta_patch} | ||
|
||
|
||
def delete_image_meta(state, dataset_id: str): | ||
meta_key = image_id_to_meta(dataset_id) | ||
delete_state(state, meta_key) |
Oops, something went wrong.