move_webui #35
@@ -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."""
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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}")
|
||||
|
||||
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user