updated imports
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
from __future__ import annotations
|
from shared.mongodb.classes import ModelData
|
||||||
|
|
||||||
from shared.dto import ModelData
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# instantiate data object
|
# instantiate data object
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ from tqdm import tqdm
|
|||||||
from utils import DEVICE, VCDADataset, load_model
|
from utils import DEVICE, VCDADataset, load_model
|
||||||
|
|
||||||
from shared.data_store import connect_minio
|
from shared.data_store import connect_minio
|
||||||
from shared.dto import ModelData
|
from shared.mongodb.classes import ModelData
|
||||||
from shared.utils import setup_logging
|
from shared.utils import setup_logging
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from torch import nn
|
from torch import nn
|
||||||
|
|
||||||
from shared.dto import ModelData
|
from shared.mongodb.classes import ModelData
|
||||||
|
|
||||||
from .angle import AngleTail
|
from .angle import AngleTail
|
||||||
from .contact import ContactTail
|
from .contact import ContactTail
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
"""Database module content."""
|
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
from .classes.dataset import Dataset
|
|
||||||
from .classes.visual_communication import VisualCommunication
|
|
||||||
from .utils.connect_mongodb import connect_mongodb
|
from .utils.connect_mongodb import connect_mongodb
|
||||||
from .utils.count_documents import count_documents
|
from .utils.count_documents import count_documents
|
||||||
from .utils.get_visual_communication import get_visual_communication
|
from .utils.get_visual_communication import get_visual_communication
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ from pydantic import BaseModel, ConfigDict
|
|||||||
from pymongo.collection import Collection
|
from pymongo.collection import Collection
|
||||||
|
|
||||||
from shared.data_store import get, put
|
from shared.data_store import get, put
|
||||||
from shared.dto import ModelData
|
from shared.mongodb.classes import ModelData
|
||||||
|
|
||||||
|
|
||||||
class VisualCommunication(BaseModel):
|
class VisualCommunication(BaseModel):
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import logging
|
|||||||
|
|
||||||
from pymongo.collection import Collection
|
from pymongo.collection import Collection
|
||||||
|
|
||||||
from shared.mongodb import VisualCommunication
|
from shared.mongodb.classes import VisualCommunication
|
||||||
from shared.mongodb.exceptions import NoDocumentFoundException
|
from shared.mongodb.exceptions import NoDocumentFoundException
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import logging
|
|||||||
|
|
||||||
from pymongo.collection import Collection
|
from pymongo.collection import Collection
|
||||||
|
|
||||||
from shared.dto import ModelData
|
from shared.mongodb.classes import ModelData
|
||||||
|
|
||||||
|
|
||||||
def upsert_annotation(
|
def upsert_annotation(
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import logging
|
|||||||
|
|
||||||
from pymongo.collection import Collection
|
from pymongo.collection import Collection
|
||||||
|
|
||||||
from shared.dto import ModelData
|
from shared.mongodb.classes import ModelData
|
||||||
|
|
||||||
|
|
||||||
def upsert_prediction(
|
def upsert_prediction(
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from pymongo.collection import Collection
|
from pymongo.collection import Collection
|
||||||
|
|
||||||
from shared.mongodb import VisualCommunication
|
from shared.mongodb.classes import VisualCommunication
|
||||||
|
|
||||||
|
|
||||||
def upsert_visual_communication(
|
def upsert_visual_communication(
|
||||||
|
|||||||
@@ -13,14 +13,9 @@ from pydantic import ValidationError
|
|||||||
from pymongo.collection import Collection
|
from pymongo.collection import Collection
|
||||||
|
|
||||||
from shared.data_store import delete as delete_from_minio
|
from shared.data_store import delete as delete_from_minio
|
||||||
from shared.dto import ModelData
|
from shared.mongodb import count_documents, get_visual_communication, upsert_annotation
|
||||||
from shared.mongodb import (
|
from shared.mongodb.classes import ModelData, VisualCommunication
|
||||||
NoDocumentFoundException,
|
from shared.mongodb.exceptions import NoDocumentFoundException
|
||||||
VisualCommunication,
|
|
||||||
count_documents,
|
|
||||||
get_visual_communication,
|
|
||||||
upsert_annotation,
|
|
||||||
)
|
|
||||||
|
|
||||||
from .layout import app_layout
|
from .layout import app_layout
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,21 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import dash_mantine_components as dmc
|
import dash_mantine_components as dmc
|
||||||
from dash import dcc
|
from dash import dcc, html
|
||||||
from dash import html
|
|
||||||
|
|
||||||
from shared.dto import AngleData
|
from shared.mongodb.classes import (
|
||||||
from shared.dto import ContactData
|
AngleData,
|
||||||
from shared.dto import DistanceData
|
ContactData,
|
||||||
from shared.dto import FramingData
|
DistanceData,
|
||||||
from shared.dto import InformationValueData
|
FramingData,
|
||||||
from shared.dto import ModalityColorData
|
InformationValueData,
|
||||||
from shared.dto import ModalityDepthData
|
ModalityColorData,
|
||||||
from shared.dto import ModalityLightingData
|
ModalityDepthData,
|
||||||
from shared.dto import PointOfViewData
|
ModalityLightingData,
|
||||||
from shared.dto import SalienceData
|
PointOfViewData,
|
||||||
from shared.dto import VisualSyntaxData
|
SalienceData,
|
||||||
|
VisualSyntaxData,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def generate_visual_syntax_options_map():
|
def generate_visual_syntax_options_map():
|
||||||
@@ -54,54 +55,63 @@ experiential_map = generate_visual_syntax_options_map()
|
|||||||
experiential_container = dmc.Col(
|
experiential_container = dmc.Col(
|
||||||
children=[
|
children=[
|
||||||
html.H4('experiential'.title()),
|
html.H4('experiential'.title()),
|
||||||
], span=5,
|
],
|
||||||
|
span=5,
|
||||||
)
|
)
|
||||||
for title, options in experiential_map.items():
|
for title, options in experiential_map.items():
|
||||||
id_dict = {'type': 'annotation', 'index': title.replace('_', '-')}
|
id_dict = {'type': 'annotation', 'index': title.replace('_', '-')}
|
||||||
experiential_container.children.append(
|
experiential_container.children.append(
|
||||||
dmc.Container([
|
dmc.Container(
|
||||||
html.B(title.title()),
|
[
|
||||||
dcc.RadioItems(
|
html.B(title.title()),
|
||||||
options=[text.replace('_', ' ') for text in options],
|
dcc.RadioItems(
|
||||||
id=id_dict,
|
options=[text.replace('_', ' ') for text in options],
|
||||||
),
|
id=id_dict,
|
||||||
]),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
)
|
)
|
||||||
# prepare interpersonal container
|
# prepare interpersonal container
|
||||||
interpersonal_map = generate_interpersonal_options_map()
|
interpersonal_map = generate_interpersonal_options_map()
|
||||||
interpersonal_container = dmc.Col(
|
interpersonal_container = dmc.Col(
|
||||||
children=[
|
children=[
|
||||||
html.H4('interpersonal'.title()),
|
html.H4('interpersonal'.title()),
|
||||||
], span=3,
|
],
|
||||||
|
span=3,
|
||||||
)
|
)
|
||||||
for title, options in interpersonal_map.items():
|
for title, options in interpersonal_map.items():
|
||||||
id_dict = {'type': 'annotation', 'index': title.replace('_', '-')}
|
id_dict = {'type': 'annotation', 'index': title.replace('_', '-')}
|
||||||
interpersonal_container.children.append(
|
interpersonal_container.children.append(
|
||||||
dmc.Container([
|
dmc.Container(
|
||||||
html.B(title.title()),
|
[
|
||||||
dcc.RadioItems(
|
html.B(title.title()),
|
||||||
options=[text.replace('_', ' ') for text in options],
|
dcc.RadioItems(
|
||||||
id=id_dict,
|
options=[text.replace('_', ' ') for text in options],
|
||||||
),
|
id=id_dict,
|
||||||
]),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
)
|
)
|
||||||
# prepare textual container
|
# prepare textual container
|
||||||
textual_map = generate_textual_options_map()
|
textual_map = generate_textual_options_map()
|
||||||
textual_container = dmc.Col(
|
textual_container = dmc.Col(
|
||||||
children=[
|
children=[
|
||||||
html.H4('textual'.title()),
|
html.H4('textual'.title()),
|
||||||
], span=4,
|
],
|
||||||
|
span=4,
|
||||||
)
|
)
|
||||||
for title, options in textual_map.items():
|
for title, options in textual_map.items():
|
||||||
id_dict = {'type': 'annotation', 'index': title.replace('_', '-')}
|
id_dict = {'type': 'annotation', 'index': title.replace('_', '-')}
|
||||||
textual_container.children.append(
|
textual_container.children.append(
|
||||||
dmc.Container([
|
dmc.Container(
|
||||||
html.B(title.title()),
|
[
|
||||||
dcc.RadioItems(
|
html.B(title.title()),
|
||||||
options=[text.replace('_', ' ') for text in options],
|
dcc.RadioItems(
|
||||||
id=id_dict,
|
options=[text.replace('_', ' ') for text in options],
|
||||||
),
|
id=id_dict,
|
||||||
]),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
labels_element = dmc.Grid(
|
labels_element = dmc.Grid(
|
||||||
|
|||||||
Reference in New Issue
Block a user