Skip to content

Commit

Permalink
clip processor skipping non json results
Browse files Browse the repository at this point in the history
why non json files are in my results folder is a different issue
  • Loading branch information
dale-wahl committed Sep 6, 2023
1 parent 24663f9 commit 9eafde0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion common/lib/dmi_service_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def request_folder_files(self, folder_name):
filename_url = f"{self.server_address}list_filenames/{folder_name}"
filename_response = requests.get(filename_url, timeout=30)

# Check if 4CAT has access to this PixPlot server
# Check if 4CAT has access to this server
if filename_response.status_code == 403:
raise DmiServiceManagerException("403: 4CAT does not have permission to use the DMI Service Manager server")
elif filename_response.status_code in [400, 405]:
Expand Down
3 changes: 3 additions & 0 deletions processors/visualisation/clip_categorize_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ def process(self):

self.dataset.log(f"Writing {result_filename}...")
with open(output_dir.joinpath(result_filename), "r") as result_file:
if not result_filename.endswith(".json"):
self.dataset.log(f"Skipping {result_filename} (not a JSON results file)")
continue
result_data = json.loads(''.join(result_file))
image_name = ".".join(result_filename.split(".")[:-1])
data = {
Expand Down

0 comments on commit 9eafde0

Please sign in to comment.