Skip to content

Commit

Permalink
update bandit configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
yunchu committed May 13, 2024
1 parent 00e7f28 commit 6ce5641
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .ci/ipas_default.config
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ exclude_dirs: [
'.vscode/',
'.git/',
'build/',
'tests',
]

### (optional) plugin settings - some test plugins require configuration data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from __future__ import annotations

import logging as log
import pickle
import pickle # nosec B403 used pickle for dumping object
from collections import defaultdict
from copy import deepcopy
from itertools import product
Expand Down
2 changes: 1 addition & 1 deletion src/otx/cli/utils/installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import os
import platform
import re
import subprocess
import subprocess # nosec B404
from importlib.metadata import requires
from importlib.util import find_spec
from pathlib import Path
Expand Down
4 changes: 2 additions & 2 deletions src/otx/core/data/dataset/action_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from __future__ import annotations

import pickle
import pickle # nosec B403
from functools import partial
from pathlib import Path
from typing import Callable
Expand Down Expand Up @@ -90,7 +90,7 @@ def _get_proposals(frame_path: str, proposal_file: str | None) -> np.ndarray:
if not proposal_file_path.exists():
return np.array([[0, 0, 1, 1]], dtype=np.float64)
with Path.open(proposal_file_path, "rb") as f:
info = pickle.load(f) # noqa: S301
info = pickle.load(f) # noqa: S301 # nosec: B301 used only for getting dataset
return (
info[",".join(Path(frame_path).stem.rsplit("_", 1))][:, :4]
if ",".join(Path(frame_path).stem.rsplit("_", 1)) in info
Expand Down
4 changes: 2 additions & 2 deletions src/otx/core/model/visual_prompting.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from __future__ import annotations

import logging as log
import pickle
import pickle # nosec: B403 used pickle dump and load only to share inference results
from collections import defaultdict
from copy import deepcopy
from functools import partial
Expand Down Expand Up @@ -1329,7 +1329,7 @@ def load_reference_info(self, default_root_dir: Path | str, *args, **kwargs) ->
if (
path_reference_info := _infer_reference_info_root / self.reference_info_dir / "reference_info.pickle"
).is_file():
reference_info: dict[str, np.ndarray] = pickle.load(path_reference_info.open("rb")) # noqa: S301
reference_info: dict[str, np.ndarray] = pickle.load(path_reference_info.open("rb")) # noqa: S301 # nosec: B301
self.reference_feats = reference_info.get(
"reference_feats",
np.zeros((0, 1, self.model["decoder"].embed_dim), dtype=np.float32),
Expand Down

0 comments on commit 6ce5641

Please sign in to comment.