Skip to content

Commit

Permalink
Merge pull request #120 from IDEA-Research/dev
Browse files Browse the repository at this point in the history
Release/0.9.3
  • Loading branch information
imhuwq authored Jan 9, 2024
2 parents 4b475a6 + a0326b7 commit 4f8490a
Show file tree
Hide file tree
Showing 175 changed files with 10,075 additions and 3,916 deletions.
Empty file modified build_doc.sh
100644 → 100755
Empty file.
10 changes: 7 additions & 3 deletions deepdataspace/model/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ def _add_annotation(self,
keypoint_colors: List[int] = None,
keypoint_skeleton: List[int] = None,
keypoint_names: List[str] = None,
caption: str = None,
confirm_type: int = 0,
):
if bbox:
Expand All @@ -341,7 +342,7 @@ def _add_annotation(self,
keypoint_skeleton,
keypoint_names)
anno_obj = Object(label_name=label, label_type=label_type, label_id=label_obj.id,
category_name=category, category_id=category_obj.id,
category_name=category, category_id=category_obj.id, caption=caption,
bounding_box=bounding_box, segmentation=segmentation, alpha=alpha_uri,
points=points, lines=lines, point_colors=colors, point_names=names,
conf=conf, is_group=is_group, confirm_type=confirm_type)
Expand All @@ -361,6 +362,7 @@ def add_annotation(self,
keypoint_colors: List[int] = None,
keypoint_skeleton: List[int] = None,
keypoint_names: List[str] = None,
caption: str = None,
confirm_type: int = 0,
):
"""
Expand All @@ -380,13 +382,14 @@ def add_annotation(self,
:param keypoint_names: the key point names, ["nose", "left_eye", ...].
:param keypoint_colors: the key point colors, [255, 0, 0, ...].
:param keypoint_skeleton: the key point skeleton, [0, 1, 2, ...].
:param caption: the caption of the annotation.
:param confirm_type: the confirm_type of the annotation, 0 = not confirmed, 1 = gt may be fn, 2 = pred may be fp
"""

self._add_annotation(category, label, label_type, conf,
is_group, bbox, segmentation, alpha_uri,
keypoints, keypoint_colors, keypoint_skeleton, keypoint_names,
confirm_type)
caption, confirm_type)

self.save()
self._update_dataset(bbox, segmentation, alpha_uri, keypoints)
Expand Down Expand Up @@ -434,6 +437,7 @@ def batch_add_annotation(self,
:param keypoint_names: the key point names, ["nose", "left_eye", ...].
:param keypoint_colors: the key point colors, [255, 0, 0, ...].
:param keypoint_skeleton: the key point skeleton, [0, 1, 2, ...].
:param caption: the caption of the annotation.
:param confirm_type: the confirm_type of the annotation, 0 = not confirmed, 1 = gt may be fn, 2 = pred may be fp
:return: None
"""
Expand All @@ -457,7 +461,7 @@ def batch_add_annotation(self,
self.objects.append(anno_obj)

def finish_batch_add_annotation(self):
self.dataset.batch_save_image(self)
self.dataset.batch_save_image()


_image_models: Dict[str, Type[ImageModel]] = {} # a cache for ImageModel for each dataset
Expand Down
9 changes: 8 additions & 1 deletion deepdataspace/plugins/coco2017/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from typing import Dict
from typing import List
from typing import Tuple
import traceback

from deepdataspace.constants import DatasetFileType
from deepdataspace.constants import DatasetType
Expand All @@ -32,6 +33,9 @@ def __init__(self, meta_path: str, enforce: bool = False):

self.meta_path = os.path.abspath(meta_path)
info = self.parse_meta(meta_path)
if info is None:
raise RuntimeError(f"Cannot import coco dataset: {meta_path}")

dataset_name = info["dataset_name"]
self.ground_truth = info["ground_truth"]
self.image_root = info["image_root"]
Expand Down Expand Up @@ -94,8 +98,11 @@ def parse_meta(meta_path: str):
try:
info = COCO2017Importer._parse_meta(meta_path)
except Exception as err:
logger.error(traceback.format_exc())
logger.error(f"Failed to parse meta file {meta_path}: {err}")
return None

logger.info(f"Successfully parsed meta file {meta_path}: {info}")
return info

def load_ground_truth(self):
Expand All @@ -118,7 +125,7 @@ def load_ground_truth(self):

def load_predictions(self):
for file_tag, file_path in self.dataset.files.items():
if not file_tag.startswith("PRED/"):
if not file_tag.startswith(f"{DatasetFileType.Prediction}/"):
continue

pred_name = file_tag.split("/", 1)[-1]
Expand Down
2 changes: 1 addition & 1 deletion deepdataspace/scripts/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
help="Set the http service port, default 8765.")
@click.option("--reload", is_flag=True, default=None,
help="Auto reload service on code change, for development only.")
@click.option("--configfile",
@click.option("--configfile", "-C",
help="Load the target yaml file to initialize more configurations. "
"The command line options take precedence of the config file.")
def start_dds(data_dir, quickstart, verbose, public, host, port, reload, configfile):
Expand Down
5 changes: 5 additions & 0 deletions deepdataspace/server/static/422.622bc3b6.async.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions deepdataspace/server/static/422.e1c904d6.async.js

This file was deleted.

10 changes: 0 additions & 10 deletions deepdataspace/server/static/482.76b40e08.async.js

This file was deleted.

1 change: 0 additions & 1 deletion deepdataspace/server/static/482.76b40e08.async.js.map

This file was deleted.

252 changes: 0 additions & 252 deletions deepdataspace/server/static/742.95758e3b.async.js

This file was deleted.

1 change: 0 additions & 1 deletion deepdataspace/server/static/742.95758e3b.async.js.map

This file was deleted.

252 changes: 252 additions & 0 deletions deepdataspace/server/static/742.e2aedde2.async.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions deepdataspace/server/static/742.e2aedde2.async.js.map

Large diffs are not rendered by default.

27 changes: 0 additions & 27 deletions deepdataspace/server/static/818.9ff3ddb4.async.js

This file was deleted.

1 change: 0 additions & 1 deletion deepdataspace/server/static/818.9ff3ddb4.async.js.map

This file was deleted.

4 changes: 2 additions & 2 deletions deepdataspace/server/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<meta name="description" content="cvr">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="shortcut icon" href="/static/favicon.png">
<link rel="stylesheet" href="/static/umi.36ffdc32.css">
<link rel="stylesheet" href="/static/umi.26db4b74.css">
</head>
<body>
<div id="root"></div>
<script src="/static/umi.e0cbfd9d.js"></script>
<script src="/static/umi.56db2ca8.js"></script>

</body></html>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4f8490a

Please sign in to comment.