LoginSignup
4
3

More than 3 years have passed since last update.

u2netqual.png

画像内の顕著なオブジェクトをセグメントしてくれるモデル。

手順

1、U2-NetのGitHubリポジトリをクローン

git clone https://github.com/NathanUA/U-2-Net.git
cd U-2-Net/
2、事前学習済みモデルをリポジトリのリンクからダウンロードし、指定のディレクトリに配置

mkdir saved_models/u2netp/
3、とりあえずPythonで試してみる。

リポジトリで配布されているモデルは174MBと4MBの2種類あって、軽量の方をつかう場合は、model_nameをu2netpに書き換えます。

あと、PytorchでデフォルトはCudaデバイス(GPU)をつかう設定になっているので、CPUで実行する場合はtorch.deviceを切り替えます

u2net_test.py
model_name='u2net'#u2netp
python u2net_test.py

4MBのモデルでこの性能。すごい。
im_21.pngim_21 (1).png

🐣


お仕事のご相談こちらまで
rockyshikoku@gmail.com

Core MLを使ったアプリを作っています。
機械学習関連の情報を発信しています。

Twitter
Medium
ホームページ

4
3
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
4
3