Skip to content

Commit

Permalink
fix bandit scan issues (openvinotoolkit#999)
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova authored Apr 10, 2023
1 parent c7c4230 commit 70fa19f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .ci/convert_notebooks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import argparse
import shutil
import subprocess
import subprocess # nosec - disable B404:import-subprocess check
import time
from pathlib import Path

Expand Down
2 changes: 1 addition & 1 deletion .ci/validate_notebooks.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion check_install.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 3 additions & 4 deletions notebooks/405-paddle-ocr-webcam/pre_post_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import numpy as np
import paddle
import math
import random

from PIL import Image, ImageDraw, ImageFont
import copy
Expand Down Expand Up @@ -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(
[
Expand Down

0 comments on commit 70fa19f

Please sign in to comment.