33 lines
871 B
Python
33 lines
871 B
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
from shared.data_store import (
|
|
connect as connect_minio,
|
|
)
|
|
from shared.database import connect
|
|
from shared.database import get_visual_communication
|
|
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()
|
|
# get visual communication
|
|
vis_com = get_visual_communication(collection)
|
|
print(repr(vis_com))
|
|
image = vis_com.get_image(minio_client=minio_client)
|
|
image.show()
|