-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deepen): add get annotation status script (#186)
* feat(deepen): add get_annotation_status Signed-off-by: Shunsuke Miura <[email protected]> * update Signed-off-by: Shunsuke Miura <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: Shunsuke Miura <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
269f67e
commit 06a3b53
Showing
2 changed files
with
49 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import argparse | ||
from datetime import datetime | ||
|
||
import yaml | ||
|
||
from perception_dataset.deepen.import_labels import AnnotationNotFoundException, get_dataset_status | ||
from perception_dataset.utils.logger import configure_logger | ||
|
||
logger = configure_logger(modname=__name__) | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument( | ||
"--config", | ||
type=str, | ||
default="config/import_labels.yaml", | ||
) | ||
args = parser.parse_args() | ||
|
||
with open(args.config) as f: | ||
config = yaml.safe_load(f) | ||
|
||
dataset_id_dict = config["conversion"]["dataset_ids"] | ||
|
||
date = datetime.now().strftime("%Y-%m-%d") | ||
log_file = f"annotation_status_{date}.log" | ||
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S") | ||
for dataset_name, dataset_id in dataset_id_dict.items(): | ||
status_msg = "" | ||
try: | ||
status = get_dataset_status(dataset_id) | ||
if status == "done": | ||
status_msg = "Done" | ||
elif status == "ready": | ||
status_msg = "Under Review" | ||
else: | ||
status_msg = status | ||
except AnnotationNotFoundException: | ||
status_msg = "Error" | ||
|
||
with open(log_file, "a") as log: | ||
log.write(f"{status_msg}\n") | ||
# log.write(f"{timestamp}, {dataset_name}, {dataset_id}, {status}\n") |
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