Skip to content

Commit dbfb74d

Browse files
authored
Merge pull request #103 from IDEA-Research/dev
release: 0.9.0
2 parents 72d20f5 + c884ac1 commit dbfb74d

34 files changed

+641
-482
lines changed

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
recursive-include deepdataspace/server/static *
22
recursive-include deepdataspace/server/templates *
3+
recursive-include deepdataspace/samples *
34
global-exclude *.py[cod]
45
global-exclude .DS_Store

build_doc.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sphinx-apidoc -o docs/api_reference deepdataspace/

ddsop.py

+13-15
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,25 @@
22
"""
33
ddsop.py
44
5-
This script adds operation commands to dds service.
6-
These command will load the same configurations generated by dds command.
7-
85
Usage: ddsop.py [OPTIONS] COMMAND [ARGS]...
96
107
Options:
118
--help Show this message and exit.
129
1310
Commands:
14-
delete_all Delete all datasets imported before.
15-
delete_one Delete a dataset.
16-
import_all Trigger a background task of importing all datasets in a...
17-
import_one Trigger a background task of importing one dataset.
18-
lpexport Export the labels of a label project.
19-
shell Enter a Python interpreter shell with all dds configs loaded.
20-
useradd Add a user by username.
21-
userban Ban a user by username.
22-
userdel Delete a user by username.
23-
useredit Edit user attributes for a user by username.
24-
userreset Reset password for a user by username.
25-
userunban Unban a user by username.
11+
delete_one Delete a dataset.
12+
import_all Trigger a background task of importing all datasets in a...
13+
import_coco Generate a coco meta file.
14+
import_one Trigger a background task of importing one dataset.
15+
lpexport Export the labels of a label project.
16+
migrate Run a migrate script.
17+
shell Enter a Python interpreter shell with all dds configs loaded.
18+
useradd Add a user by username.
19+
userban Ban a user by username.
20+
userdel Delete a user by username.
21+
useredit Edit user attributes for a user by username.
22+
userreset Reset password for a user by username.
23+
userunban Unban a user by username.
2624
"""
2725

2826
from deepdataspace.scripts import ddsop

deepdataspace/algos/calculate_fnfp.py

+41-14
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,37 @@ def calculate_thresholds(all_gt: List[List],
3838
"""
3939
For given IoU thresh, calculate confidence thresh for precisions from 0.0 to 1.0 .
4040
41-
:param all_gt: All ground truth objects from a subset
42-
[image_id(str), category_id(int), bbox(List[int])], bbox = [x1, y1, x2, y2]
43-
:param all_det: All prediction objects from a subset
44-
[image_id(str), category_id(int), bbox(List[int]), conf(float)], bbox = [x1, y1, x2, y2]
45-
:param iou_thresh: IoU threshold
46-
:return [
47-
{"conf_thresh": xxx, "recall": xxx, "precision": xxx, "precision_thresh": xxx}
41+
:param all_gt: All ground truth objects from a subset.
42+
43+
.. code-block:: python
44+
45+
[
46+
# [image_id, category_id, [x1, y1, x2, y2]]
47+
[1, 1, [10, 20, 30, 40]],
48+
]
49+
50+
:param all_det: All prediction objects from a subset.
51+
52+
.. code-block:: python
53+
54+
[
55+
# [image_id, category_id, [x1, y1, x2, y2], conf]
56+
[1, 1, [10, 20, 33, 43], 0.8],
57+
]
58+
59+
:param iou_thresh: float.
60+
61+
:return conf thresholds: list of dict.
62+
63+
.. code-block:: python
64+
65+
[
66+
{
67+
"conf_thresh": 10,
68+
"recall": 10,
69+
"precision": 10,
70+
"precision_thresh": 10.1
71+
}
4872
]
4973
"""
5074

@@ -159,14 +183,17 @@ def calculate_fnfp(all_gt: List[List],
159183
"""
160184
For given IoU thresh, check the correctness of all predictions in an image.
161185
162-
:param all_gt: All ground truth objects from a subset
163-
[category_id(int), bbox(List[int])], bbox = [x1, y1, x2, y2]
164-
:param all_det: All prediction objects from a subset
165-
[category_id(int), bbox(List[int]), conf(float)], bbox = [x1, y1, x2, y2]
186+
:param all_gt:
187+
| All ground truth objects from a subset
188+
| [category_id(int), bbox(List[int])], bbox = [x1, y1, x2, y2]
189+
:param all_det:
190+
| All prediction objects from a subset
191+
| [category_id(int), bbox(List[int]), conf(float)], bbox = [x1, y1, x2, y2]
166192
:param iou_thresh: IoU threshold
167-
:return (gt_results, det_results)
168-
gt_results, list, -1 means FN, otherwise means matched det id
169-
det_results, list, 1 means TP, 0 means FP
193+
:return tuple of list of int:
194+
| (gt_results, det_results)
195+
| gt_results, list, -1 means FN, otherwise means matched det id
196+
| det_results, list, 1 means TP, 0 means FP
170197
"""
171198

172199
gt_arr = np.array(all_gt[:], dtype=np.float32)

deepdataspace/constants.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,15 @@ class ContentEncoding:
239239
ALL_ = {Plain, Base64}
240240

241241

242-
class TSVFileType:
242+
class DatasetFileType:
243243
"""
244-
| TSV dataset related file types.
245-
| TSV dataset format may contain multiple files, each of these types:
244+
Dataset related file types.
246245
"""
247246

248-
Embedding = "Embedding" #: .embd file, used by :class:`deepdataspace.plugins.tsv.process.RankByFlags`.
249-
Prediction = "Pred" #: .pred file, used by :class:`deepdataspace.plugins.tsv.importer.TSVImporter`.
250-
GroundTruth = LabelName.GroundTruth #: .tsv file, used by :class:`deepdataspace.plugins.tsv.importer.TSVImporter`.
247+
GroundTruth = LabelName.GroundTruth
248+
Prediction = "Pred"
249+
Embedding = "Embedding"
250+
Meta = "Meta"
251251

252252

253253
class LabelProjectStatus:
@@ -286,12 +286,12 @@ class LabelProjectRoles:
286286
ReviewKinds_ = {Reviewer, ReviewLeader} #: Roles that take part in the reviewing process.
287287

288288
Levels_ = {
289-
Owner: 0,
290-
Manager: 1,
291-
LabelLeader: 2,
289+
Owner : 0,
290+
Manager : 1,
291+
LabelLeader : 2,
292292
ReviewLeader: 3,
293-
Labeler: 4,
294-
Reviewer: 5
293+
Labeler : 4,
294+
Reviewer : 5
295295
} #: The level of every role, smaller number means higher level.
296296

297297

deepdataspace/environs.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@
2929
3030
.. data:: DDS_RUNTIME_DIR
3131
32-
| The runtime directory of dds.
32+
The runtime directory of dds.
3333
3434
:default: ``~/.deepdataspace``
3535
3636
.. data:: DDS_DJANGO_DIR
37+
3738
The runtime directory of django which includes django log files.
3839
3940
:default: ``$DDS_RUNTIME_DIR/django``

0 commit comments

Comments
 (0)