genai exception handling and lint all

Signed-off-by: vladmandic <mandic00@live.com>
This commit is contained in:
vladmandic
2025-12-22 20:29:50 +01:00
parent 4c35d3887e
commit dde91321b9
7 changed files with 24 additions and 8 deletions
+1 -1
View File
@@ -147,7 +147,7 @@ class YoloRestorer(Detailer):
try:
seg = (255 * seg).astype(np.uint8)
seg = Image.fromarray(seg).resize(image.size).convert('L')
except:
except Exception:
seg = None
cls = int(cls)
label = prediction.names[cls] if cls < len(prediction.names) else f'cls{cls}'