updated to use new class
This commit is contained in:
@@ -2,10 +2,27 @@ from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from shared.database.classes import VisualCommunication
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from shared.data_store import connect as connect_minio
|
||||
from shared.database import connect as connect_mongo
|
||||
from shared.database.classes import VisualCommunication
|
||||
from shared.utils import check_env
|
||||
from shared.utils import setup_logging
|
||||
|
||||
if __name__ == '__main__':
|
||||
# load in env file
|
||||
env_path = Path(__file__).parent.parent / 'server.env'
|
||||
assert env_path.exists()
|
||||
load_dotenv(env_path)
|
||||
# ensure env vars set
|
||||
check_env()
|
||||
# setup logging
|
||||
setup_logging()
|
||||
# connect to minIO
|
||||
minio_client = connect_minio()
|
||||
# connect to MongoDB
|
||||
collection, db, client = connect_mongo()
|
||||
# get list of image paths
|
||||
test_dir = Path(__file__).parent
|
||||
img_dir = test_dir / 'imgs'
|
||||
@@ -13,7 +30,7 @@ if __name__ == '__main__':
|
||||
print(img_path_list)
|
||||
# instantiate data object
|
||||
vis_com_list = [
|
||||
VisualCommunication.from_file(path)
|
||||
VisualCommunication.from_file(path, minio_client=minio_client)
|
||||
for path
|
||||
in img_path_list
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user