Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/backend-schema-refactor' into ba…
Browse files Browse the repository at this point in the history
…ckend-schema-refactor
  • Loading branch information
farisdurrani committed Jul 7, 2023
2 parents 6a673ad + 01b0f1a commit dda10d6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions backend/aws_helpers/s3_utils/s3_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def make_train_bucket_path(trainspace_data: TrainspaceData) -> str:
filename = trainspace_data.dataset_data["name"]
return f"{uid}/{data_source}/{filename}"


def get_presigned_url_from_bucket(bucket_name: str, bucket_path: str):
"""
Given S3 URI, read the file from the S3 bucket
Expand Down
5 changes: 4 additions & 1 deletion backend/dl/detection.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from backend.aws_helpers.dynamo_db_utils.trainspace_db import TrainspaceData
from backend.aws_helpers.s3_utils.s3_bucket_names import FILE_UPLOAD_BUCKET_NAME
from backend.aws_helpers.s3_utils.s3_client import make_train_bucket_path, read_from_bucket
from backend.aws_helpers.s3_utils.s3_client import (
make_train_bucket_path,
read_from_bucket,
)
from backend.common.constants import IMAGE_FILE_DOWNLOAD_TMP_PATH
from transformers import YolosFeatureExtractor, YolosForObjectDetection
import torch
Expand Down
6 changes: 3 additions & 3 deletions backend/dl/dl_model_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ def parse_deep_user_architecture(layers):
converted_data = []

for item in layers:
value = item['value']
parameters = item['parameters']
value = item["value"]
parameters = item["parameters"]

if value not in LAYERS_NN_MAPPING:
raise Exception(f"Layer ${value} not supported")

linear_layer = LAYERS_NN_MAPPING[value](*parameters)
converted_data.append(linear_layer)

Expand Down

0 comments on commit dda10d6

Please sign in to comment.