move_webui #35

Merged
brian merged 17 commits from move_webui into main 2024-05-21 16:19:33 +02:00
5 changed files with 13 additions and 9 deletions
Showing only changes of commit e3e836c9fa - Show all commits
+1 -2
View File
@@ -6,10 +6,9 @@ from pathlib import Path
import pandas as pd
import requests
from classes import Instagram
from retry import retry
from image_download.classes import Instagram
def get_sources() -> pd.DataFrame:
"""Get sources dateframe."""
+4 -1
View File
@@ -11,6 +11,9 @@ if __name__ == '__main__':
in range(3)
]
# generate random predictions
[vis_com.generate_random_prediction() for vis_com in vis_com_list]
[
vis_com.generate_random_prediction()
for vis_com in vis_com_list
] # type: ignore
for vis_com in vis_com_list:
print(vis_com)
+2 -2
View File
@@ -7,7 +7,7 @@ from pathlib import Path
from dotenv import load_dotenv
from core.database import connect
from core.database import upsert_predictions
from core.database import upsert_prediction
from core.database.classes import VisualCommunication
if __name__ == '__main__':
@@ -45,7 +45,7 @@ if __name__ == '__main__':
for vis_com in vis_com_list:
if vis_com.prediction is None:
continue
upsert_predictions(
upsert_prediction(
collection=collection,
vis_com_name=vis_com.name,
predictions=vis_com.prediction,
+3 -2
View File
@@ -6,7 +6,7 @@ from pathlib import Path
from dotenv import load_dotenv
from core.database import connect
from core.database import total_documents
from core.database import count_documents
if __name__ == '__main__':
# prepare env vars
@@ -17,7 +17,8 @@ if __name__ == '__main__':
# connect to database
collection, db, client = connect()
# get visual communication
num_docs = total_documents(
num_docs = count_documents(
collection=collection,
only_with_annotation=True,
)
print(f"number of annotated documents in database: {num_docs}")
+3 -2
View File
@@ -6,7 +6,7 @@ from pathlib import Path
from dotenv import load_dotenv
from core.database import connect
from core.database import total_documents
from core.database import count_documents
if __name__ == '__main__':
# prepare env vars
@@ -17,7 +17,8 @@ if __name__ == '__main__':
# connect to database
collection, db, client = connect()
# get visual communication
num_docs = total_documents(
num_docs = count_documents(
collection=collection,
only_with_annotation=False,
)
print(f"total number of documents in database: {num_docs}")