Skip to content

Commit

Permalink
adjust format
Browse files Browse the repository at this point in the history
  • Loading branch information
mucunwuxian committed Jan 12, 2024
1 parent 98d6a94 commit 950971b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def run(
name="exp", # save results to project/name
exist_ok=False, # existing project/name ok, do not increment
line_thickness=3, # bounding box thickness (pixels)
line_alpha=0.5, # bounding box transparency: 0.0:transparent - 1.0:opaque
line_alpha=0.5, # bounding box transparency (opacity 0.0-1.0)
hide_labels=False, # hide labels
hide_conf=False, # hide confidences
half=False, # use FP16 half-precision inference
Expand Down Expand Up @@ -225,9 +225,8 @@ def write_to_csv(image_name, prediction, confidence):

# Stream results
im0 = annotator.result()
im0 = ((im0.astype(np.float32) * (1 - opt.line_alpha)) + (im0s.astype(np.float32) * opt.line_alpha)).astype(
np.uint8
)
im0 = ((im0.astype(np.float32) * (1 - opt.line_alpha)) + (im0s.astype(np.float32) * opt.line_alpha))
im0 = im0.astype(np.uint8)
if view_img:
if platform.system() == "Linux" and p not in windows:
windows.append(p)
Expand Down Expand Up @@ -293,9 +292,7 @@ def parse_opt():
parser.add_argument("--name", default="exp", help="save results to project/name")
parser.add_argument("--exist-ok", action="store_true", help="existing project/name ok, do not increment")
parser.add_argument("--line-thickness", default=3, type=int, help="bounding box thickness (pixels)")
parser.add_argument(
"--line-alpha", default=0.5, type=float, help="bounding box transparency: 0.0:transparent - 1.0:opaque"
)
parser.add_argument("--line-alpha", default=0.5, type=float, help="bounding box transparency (opacity 0.0-1.0)")
parser.add_argument("--hide-labels", default=False, action="store_true", help="hide labels")
parser.add_argument("--hide-conf", default=False, action="store_true", help="hide confidences")
parser.add_argument("--half", action="store_true", help="use FP16 half-precision inference")
Expand Down

0 comments on commit 950971b

Please sign in to comment.