From c0e4b2fb6e422403fa30a8f296d7a66221191bd3 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 9 Jun 2024 03:51:36 +0200 Subject: [PATCH] Refactor code for speed and clarity --- general_json2yolo.py | 1 - labelbox_json2yolo.py | 1 - utils.py | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/general_json2yolo.py b/general_json2yolo.py index 5a43d37..fc10833 100644 --- a/general_json2yolo.py +++ b/general_json2yolo.py @@ -5,7 +5,6 @@ import cv2 import pandas as pd from PIL import Image - from utils import * diff --git a/labelbox_json2yolo.py b/labelbox_json2yolo.py index bd3e878..c8899fe 100644 --- a/labelbox_json2yolo.py +++ b/labelbox_json2yolo.py @@ -6,7 +6,6 @@ import yaml from PIL import Image from tqdm import tqdm - from utils import make_dirs diff --git a/utils.py b/utils.py index aabbdf3..5fac818 100644 --- a/utils.py +++ b/utils.py @@ -24,7 +24,7 @@ def exif_size(img): rotation = dict(img._getexif().items())[orientation] if rotation in [6, 8]: # rotation 270 s = (s[1], s[0]) - except: + except Exception: pass return s