This commit is contained in:
@@ -5,9 +5,9 @@ from pathlib import Path
|
||||
from dotenv import load_dotenv
|
||||
from pymongo.errors import DuplicateKeyError
|
||||
|
||||
from shared.datastore import connect_minio
|
||||
from shared.datastore import Datastore
|
||||
from shared.mongodb import connect_mongodb
|
||||
from shared.mongodb.classes import VisualCommunication
|
||||
from shared.mongodb.src.classes import VisualCommunication
|
||||
from shared.utils import check_env, setup_logging
|
||||
from web_ui.src.main import NECESSARY_ENV_VAR_LIST
|
||||
|
||||
@@ -21,7 +21,9 @@ if __name__ == '__main__':
|
||||
# setup logging
|
||||
setup_logging()
|
||||
# connect to minIO
|
||||
minio_client = connect_minio()
|
||||
datastore = Datastore()
|
||||
datastore.connect()
|
||||
assert datastore._client is not None
|
||||
# connect to MongoDB
|
||||
collection, db, client = connect_mongodb()
|
||||
# get list of image paths
|
||||
@@ -37,7 +39,7 @@ if __name__ == '__main__':
|
||||
print(f"found {len(img_path_list)} images")
|
||||
# create visual communication objects
|
||||
vis_com_list = [
|
||||
VisualCommunication.from_file(path, minio_client=minio_client)
|
||||
VisualCommunication.from_file(path, minio_client=datastore._client)
|
||||
for path in img_path_list
|
||||
]
|
||||
print(f"created {len(vis_com_list)} visual communication objects")
|
||||
|
||||
Reference in New Issue
Block a user