diff --git a/.ci/convert_notebooks.py b/.ci/convert_notebooks.py index ae1066e2494..35212989a3e 100644 --- a/.ci/convert_notebooks.py +++ b/.ci/convert_notebooks.py @@ -1,6 +1,6 @@ import argparse import shutil -import subprocess +import subprocess # nosec - disable B404:import-subprocess check import time from pathlib import Path diff --git a/.ci/validate_notebooks.py b/.ci/validate_notebooks.py index dfa28958294..e3bfd205660 100644 --- a/.ci/validate_notebooks.py +++ b/.ci/validate_notebooks.py @@ -1,6 +1,6 @@ import sys import os -import subprocess +import subprocess # nosec - disable B404:import-subprocess check import csv import shutil from pathlib import Path diff --git a/check_install.py b/check_install.py index f3aad4c77ec..1bf161afd16 100644 --- a/check_install.py +++ b/check_install.py @@ -1,5 +1,5 @@ import os -import subprocess +import subprocess # nosec - disable B404:import-subprocess check import sys from pathlib import Path from pprint import pprint diff --git a/notebooks/405-paddle-ocr-webcam/pre_post_processing.py b/notebooks/405-paddle-ocr-webcam/pre_post_processing.py index 74ad23dc61d..e17a9f14a2e 100644 --- a/notebooks/405-paddle-ocr-webcam/pre_post_processing.py +++ b/notebooks/405-paddle-ocr-webcam/pre_post_processing.py @@ -3,7 +3,6 @@ import numpy as np import paddle import math -import random from PIL import Image, ImageDraw, ImageFont import copy @@ -423,14 +422,14 @@ def draw_ocr_box_txt(image, img_left = image.copy() img_right = Image.new('RGB', (w, h), (255, 255, 255)) - random.seed(0) + np.random.seed(0) draw_left = ImageDraw.Draw(img_left) draw_right = ImageDraw.Draw(img_right) for idx, (box, txt) in enumerate(zip(boxes, txts)): if scores is not None and scores[idx] < drop_score: continue - color = (random.randint(0, 255), random.randint(0, 255), - random.randint(0, 255)) + color = (np.random.randint(0, 255), np.random.randint(0, 255), + np.random.randint(0, 255)) draw_left.polygon(box, fill=color) draw_right.polygon( [