fixed deprecated import
This commit is contained in:
@@ -4,11 +4,10 @@ from pathlib import Path
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from shared.data_store import connect as connect_minio
|
||||
from shared.data_store import 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
|
||||
from shared.utils import check_env, setup_logging
|
||||
|
||||
if __name__ == '__main__':
|
||||
# load in env file
|
||||
@@ -31,8 +30,7 @@ if __name__ == '__main__':
|
||||
# instantiate data object
|
||||
vis_com_list = [
|
||||
VisualCommunication.from_file(path, minio_client=minio_client)
|
||||
for path
|
||||
in img_path_list
|
||||
for path in img_path_list
|
||||
]
|
||||
# generate random predictions
|
||||
for vis_com in vis_com_list:
|
||||
|
||||
@@ -4,13 +4,9 @@ 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
|
||||
from shared.data_store import connect_minio
|
||||
from shared.database import connect, get_visual_communication
|
||||
from shared.utils import check_env, setup_logging
|
||||
|
||||
if __name__ == '__main__':
|
||||
# load in env file
|
||||
|
||||
@@ -5,11 +5,10 @@ from pathlib import Path
|
||||
from dotenv import load_dotenv
|
||||
from pymongo.errors import DuplicateKeyError
|
||||
|
||||
from shared.data_store import connect as connect_minio
|
||||
from shared.data_store import 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
|
||||
from shared.utils import check_env, setup_logging
|
||||
|
||||
if __name__ == '__main__':
|
||||
# load in env file
|
||||
@@ -32,8 +31,7 @@ if __name__ == '__main__':
|
||||
# instantiate data object
|
||||
vis_com_list = [
|
||||
VisualCommunication.from_file(path, minio_client=minio_client)
|
||||
for path
|
||||
in img_path_list
|
||||
for path in img_path_list
|
||||
]
|
||||
for vis_com in vis_com_list:
|
||||
print(repr(vis_com))
|
||||
|
||||
@@ -5,11 +5,10 @@ from pathlib import Path
|
||||
from dotenv import load_dotenv
|
||||
from pymongo.errors import DuplicateKeyError
|
||||
|
||||
from shared.data_store import connect as connect_minio
|
||||
from shared.database import connect as connect_mongo
|
||||
from shared.data_store import connect_minio
|
||||
from shared.database import VisualCommunication
|
||||
from shared.utils import check_env
|
||||
from shared.utils import setup_logging
|
||||
from shared.database import connect as connect_mongo
|
||||
from shared.utils import check_env, setup_logging
|
||||
|
||||
if __name__ == '__main__':
|
||||
# load in env file
|
||||
@@ -28,16 +27,17 @@ if __name__ == '__main__':
|
||||
ext_img_dir = Path('/Volumes/BW-PSSD/Mixed Methods/')
|
||||
assert ext_img_dir.exists()
|
||||
img_path_list = [
|
||||
path for path in ext_img_dir.glob(
|
||||
path
|
||||
for path in ext_img_dir.glob(
|
||||
'*.jpg',
|
||||
) if path.is_file()
|
||||
)
|
||||
if path.is_file()
|
||||
]
|
||||
print(f"found {len(img_path_list)} images")
|
||||
# create visual communication objects
|
||||
vis_com_list = [
|
||||
VisualCommunication.from_file(path, minio_client=minio_client)
|
||||
for path
|
||||
in img_path_list
|
||||
for path in img_path_list
|
||||
]
|
||||
print(f"created {len(vis_com_list)} visual communication objects")
|
||||
# upload images
|
||||
|
||||
@@ -7,7 +7,7 @@ from dotenv import load_dotenv
|
||||
from torchinfo import summary
|
||||
|
||||
from model.src.models import VisualCommunicationModel
|
||||
from shared.data_store import connect, put_model
|
||||
from shared.data_store import connect_minio, put_model
|
||||
from shared.utils import setup_logging
|
||||
|
||||
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
||||
@@ -20,7 +20,7 @@ if __name__ == '__main__':
|
||||
# setup logging
|
||||
setup_logging()
|
||||
# connect to minio
|
||||
client = connect()
|
||||
client = connect_minio()
|
||||
# instantiate model
|
||||
model = VisualCommunicationModel().to(DEVICE)
|
||||
# show model weights
|
||||
|
||||
@@ -4,12 +4,11 @@ from pathlib import Path
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from shared.data_store import connect as connect_minio
|
||||
from shared.data_store import connect_minio
|
||||
from shared.database import connect as connect_mongo
|
||||
from shared.database import upsert_prediction
|
||||
from shared.database.classes import VisualCommunication
|
||||
from shared.utils import check_env
|
||||
from shared.utils import setup_logging
|
||||
from shared.utils import check_env, setup_logging
|
||||
|
||||
if __name__ == '__main__':
|
||||
# load in env file
|
||||
@@ -31,8 +30,7 @@ if __name__ == '__main__':
|
||||
# instantiate data object
|
||||
vis_com_list = [
|
||||
VisualCommunication.from_file(path, minio_client=minio_client)
|
||||
for path
|
||||
in img_path_list
|
||||
for path in img_path_list
|
||||
]
|
||||
# generate random predictions
|
||||
for vis_com in vis_com_list:
|
||||
|
||||
Reference in New Issue
Block a user