Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactoring #98

Closed
2 tasks done
sngyo opened this issue May 14, 2020 · 8 comments
Closed
2 tasks done

refactoring #98

sngyo opened this issue May 14, 2020 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@sngyo
Copy link
Contributor

sngyo commented May 14, 2020

  • やはり,5ループ回しているのが推論パフォーマンス計測のためということがわかりづらいようなので全モデルに対してコメントをいれる
  • この際に,全てrecognize_from...という関数名でメイン関数を書いていたのをモデルにそぐわない場合は変更しておく
@sngyo sngyo self-assigned this May 14, 2020
@kyakuno
Copy link
Collaborator

kyakuno commented May 15, 2020

コマンドライン引数にループを回す回数を指定できるようにする方が良いですかね。

@kyakuno
Copy link
Collaborator

kyakuno commented May 15, 2020

デフォルトでは処理時間非表示、--benchmarkを指定すると5回処理して処理時間表示、というイメージです。

@sngyo
Copy link
Contributor Author

sngyo commented May 15, 2020

回数は指定できた方がよろしいでしょうか?必要なければ

デフォルトでは処理時間非表示、--benchmarkを指定すると5回処理して処理時間表示、というイメージです。

で進めます.

現状同様動画モードの際にはbenchmarkは無効とします. (READMEかargsのhelpに明示するようにします)

@kyakuno
Copy link
Collaborator

kyakuno commented May 15, 2020

回数は固定で良いと思います。

@sngyo
Copy link
Contributor Author

sngyo commented May 15, 2020

$ python3 arcface.py -h
usage: arcface.py [-h] [-i IMAGE IMAGE] [-v VIDEO IMAGE] [-b]

Determine if the person is the same from two facial images.

optional arguments:
  -h, --help            show this help message and exit
  -i IMAGE IMAGE, --inputs IMAGE IMAGE
                        Two image paths for calculating the face match.
  -v VIDEO IMAGE, --video VIDEO IMAGE
                        Determines whether the face in the video file
                        specified by VIDEO and the face in the image file
                        specified by IMAGE are the same. If the VIDEO argument
                        is set to 0, the webcam input will be used.
  -b, --benchmark       Running the inference on the same input 5 times to
                        measure execution performance. (Cannot be used in
                        video mode)

$ python3 arcface.py
ONNX file and Prototxt file are prepared!
env_id: 2
Start inference...
Similarity of (correct_pair_1.jpg, correct_pair_2.jpg) : 0.598
They are the same face!

$ python3 arcface.py -b
ONNX file and Prototxt file are prepared!
env_id: 2
Start inference...
BENCHMARK mode
	ailia processing time 740 ms
	ailia processing time 135 ms
	ailia processing time 129 ms
	ailia processing time 109 ms
	ailia processing time 101 ms
Similarity of (correct_pair_1.jpg, correct_pair_2.jpg) : 0.598
They are the same face!

このようなフォーマットでとりあえず進めます.
Start inference...のようなメッセージをどのくらい入れるべきか,そもそも必要かも悩みどころです.

@sngyo
Copy link
Contributor Author

sngyo commented May 15, 2020

いろいろ気になる点が出てきているのでailiaの様子を見ながらPRすることにします

@sngyo
Copy link
Contributor Author

sngyo commented May 19, 2020

ビデオ入力時の,

if not ret:
    continue

がなぜcontinueにしたのか思い出せないがこれだと強制的に抜けない限り無限ループし続ける設定になっているようなので,

if not ret:
    break

に変更したほうがよさそう (一応 webcam の動作が変わってしまったりしないことを確認する)

@sngyo
Copy link
Contributor Author

sngyo commented May 21, 2020

TODO

次回以降

  • if not ret: breakにすべて変更する

@sngyo sngyo added the enhancement New feature or request label May 21, 2020
@sngyo sngyo closed this as completed May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants