1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

YOLOv8で検出時のコンソール出力を消す

Last updated at Posted at 2024-08-17

目的

ultrayticsのライブラリででYOLOv8を使っている時、コンソールへ出力される検出結果が邪魔...
(特にリアルタイムでの検出とか)

具体的には、下の画像のような出力を消したい
image.png
・・・

調べてみた感じそれらしい記事がなかったので備忘録として残しとく

方法

推論実行前に以下のコードを記載しておく

from logging import getLogger
logger = getLogger('ultralytics')
logger.disabled = True

たったこれだけ

おわりに

てっきり console_output=False みたいな引数があるものかと思ってた...
そりゃlogger使ってやってるよな(今更)

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?