mirror of
https://github.com/MarcA711/frigate-rockchip.git
synced 2025-10-07 09:40:58 +08: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,6 +1,6 @@
|
||||
import ctypes
|
||||
import logging
|
||||
|
||||
import ctypes
|
||||
import numpy as np
|
||||
|
||||
try:
|
||||
@@ -8,13 +8,14 @@ try:
|
||||
from cuda import cuda
|
||||
|
||||
TRT_SUPPORT = True
|
||||
except ModuleNotFoundError as e:
|
||||
except ModuleNotFoundError:
|
||||
TRT_SUPPORT = False
|
||||
|
||||
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 Field
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -172,7 +173,7 @@ class TensorRtDetector(DetectionApi):
|
||||
if not self.context.execute_async_v2(
|
||||
bindings=self.bindings, stream_handle=self.stream
|
||||
):
|
||||
logger.warn(f"Execute returned false")
|
||||
logger.warn("Execute returned false")
|
||||
|
||||
# Transfer predictions back from the GPU.
|
||||
[
|
||||
|
Reference in New Issue
Block a user