add_model_resnet18 #31

Merged
brian merged 47 commits from add_model_resnet18 into main 2024-04-03 21:04:23 +02:00
Showing only changes of commit bb95e78132 - Show all commits
+3 -3
View File
@@ -6,16 +6,16 @@ from pymongo.collection import Collection
def count_documents(
collection: Collection,
has_annotation: bool = False,
only_with_annotation: bool = False,
) -> int:
"""
Get the total number of documents
in database that matches the filters.
"""
assert isinstance(collection, Collection)
assert isinstance(has_annotation, bool)
assert isinstance(only_with_annotation, bool)
# build query
query = {}
if has_annotation:
if only_with_annotation:
query['annotation'] = {'$ne': None}
return collection.count_documents(filter=query)