mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-08-01 08:32:18 +03:00
Add isort and ruff linter (#6575)
* Add isort and ruff linter Both linters are pretty common among modern python code bases. The isort tool provides stable sorting and grouping, as well as pruning of unused imports. Ruff is a modern linter, that is very fast due to being written in rust. It can detect many common issues in a python codebase. Removes the pylint dev requirement, since ruff replaces it. * treewide: fix issues detected by ruff * treewide: fix bare except clauses * .devcontainer: Set up isort * treewide: optimize imports * treewide: apply black * treewide: make regex patterns raw strings This is necessary for escape sequences to be properly recognized.
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import io
|
||||
import logging
|
||||
|
||||
import numpy as np
|
||||
import requests
|
||||
import io
|
||||
from PIL import Image
|
||||
from pydantic import Field
|
||||
from typing_extensions import Literal
|
||||
|
||||
from frigate.detectors.detection_api import DetectionApi
|
||||
from frigate.detectors.detector_config import BaseDetectorConfig
|
||||
from typing_extensions import Literal
|
||||
from pydantic import Extra, Field
|
||||
from PIL import Image
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -64,11 +64,11 @@ class DeepStack(DetectionApi):
|
||||
for i, detection in enumerate(response_json.get("predictions")):
|
||||
logger.debug(f"Response: {detection}")
|
||||
if detection["confidence"] < 0.4:
|
||||
logger.debug(f"Break due to confidence < 0.4")
|
||||
logger.debug("Break due to confidence < 0.4")
|
||||
break
|
||||
label = self.get_label_index(detection["label"])
|
||||
if label < 0:
|
||||
logger.debug(f"Break due to unknown label")
|
||||
logger.debug("Break due to unknown label")
|
||||
break
|
||||
detections[i] = [
|
||||
label,
|
||||
|
||||
Reference in New Issue
Block a user