Skip to content

Commit

Permalink
fix min conf
Browse files Browse the repository at this point in the history
  • Loading branch information
Koldim2001 committed Aug 5, 2024
1 parent c07b0e8 commit fd6d59e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
18 changes: 8 additions & 10 deletions AutoCvat.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,14 @@ def main(**kwargs):
if conf is not None:
dict_confs = {}
else:
conf = 0.01 # default conf
try:
dict_confs = configs["confs"]
if classes_coco != list(dict_confs):
raise LengthMismatchError(
"Class list and confidence threshold dictionary keys list do not match. "
"Each class must correspond to a confidence threshold."
)
except KeyError:
dict_confs = {}
dict_confs = configs.get("confs", {})
if classes_coco != list(dict_confs):
raise LengthMismatchError(
"Class list and confidence threshold dictionary keys list do not match. "
"Each class must correspond to a confidence threshold."
)
min_value_conf = min((float(value) for value in dict_confs.values()))
conf = min_value_conf # default conf as min conf of classes

# If the result folder already exists, delete it and create a new one
if os.path.exists(result_folder):
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ You can also combine several classes into one by giving them the same name in th
```
names:
0: person
1: car
2: car
3: car
5: car
7: car
14: bird
confs:
0: 0.7
1: 0.4
2: 0.4
3: 0.5
5: 0.4
7: 0.5
14: 0.3
iou: 0.7
imgsz: 640
Expand Down

0 comments on commit fd6d59e

Please sign in to comment.