deepinsight / insightface

State-of-the-art 2D and 3D Face Analysis Project
https://insightface.ai
22.76k stars 5.34k forks source link

Remove print in model zoo #2481

Open jonatansalemes opened 9 months ago

jonatansalemes commented 9 months ago

https://github.com/deepinsight/insightface/blob/c2db41402c627cab8ea32d55da591940f2258276/python-package/insightface/model_zoo/model_zoo.py#L41

jonatansalemes commented 9 months ago

there are many prints in the code, can we cleanup all, changing to log maybe ?

Neptune-Trojans commented 9 months ago

Actually this print is informative, this way is clear if you use GPU or CPU or etc...

jonatansalemes commented 9 months ago

no problem with prints, im talking about change to log instead print to stdout directly

changchiyou commented 8 months ago

@jslsolucoes Try this https://docs.python.org/zh-tw/3.8/library/contextlib.html#contextlib.redirect_stdout

jonatansalemes commented 8 months ago

@jslsolucoes Try this https://docs.python.org/zh-tw/3.8/library/contextlib.html#contextlib.redirect_stdout

no thanks, i dont want redirect stoud as workaround, best way is for sure using log library, makes no sense deal this way with the problem

changchiyou commented 8 months ago

@jslsolucoes

  1. Fork this repo and edit by yourself
  2. Redirect only the stdout output specifically from insightface (https://loguru.readthedocs.io/en/stable/resources/recipes.html#capturing-standard-stdout-stderr-and-warnings)
ycuk commented 6 months ago

why not to use logging? that way give us to output desired logging level.