Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions preprocessors/depth-map-gen/depth-map-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ def depthgenerator():
classifier_1 = "ca.mcgill.a11y.image.preprocessor.contentCategoriser"
if classifier_1 in preprocess_output:
classifier_1_output = preprocess_output[classifier_1]
classifier_1_label = classifier_1_output.get("category", "")
if classifier_1_label != "photograph":
categoriser_tags = classifier_1_output["categories"]
if not categoriser_tags["photo"]:
logging.info("Not photograph content. Skipping...")
return "", 204
else:
Expand Down
5 changes: 2 additions & 3 deletions preprocessors/graphic-tagger/azure_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,8 @@ def categorise():
if content_classifier in preprocess_output:
content_classifier_output = \
preprocess_output[content_classifier]
content_label = \
content_classifier_output["category"]
if content_label == "photograph":
categoriser_tags = content_classifier_output["categories"]
if categoriser_tags["photo"]:
source = content["graphic"]
image_b64 = source.split(",")[1]
binary = base64.b64decode(image_b64)
Expand Down
5 changes: 3 additions & 2 deletions preprocessors/mmsemseg/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,9 @@ def segment():
# if the architecture is modified appropriately
if classifier_1 in preprocess_output:
classifier_1_output = preprocess_output[classifier_1]
classifier_1_label = classifier_1_output["category"]
if classifier_1_label != "photograph":
categoriser_tags = classifier_1_output["categories"]

if not categoriser_tags["photo"]:
logging.info("Not photograph content. Skipping...")
return "", 204
if classifier_2 in preprocess_output:
Expand Down
6 changes: 3 additions & 3 deletions preprocessors/object-detection-azure/objdetect.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ def categorise():
if content_classifier in preprocess_output:
content_classifier_output = \
preprocess_output[content_classifier]
content_label = \
content_classifier_output["category"]
if content_label == "photograph":
content_tags = \
content_classifier_output["categories"]
if content_tags["photo"]:
source = content["graphic"]
image_b64 = source.split(",")[1]
binary = base64.b64decode(image_b64)
Expand Down