Condaã¯ã€ãã¯ã¹ã¿ãŒãã¬ã€ãUltralytics
ãã®ã¬ã€ãã§ã¯ãUltralytics ãããžã§ã¯ãã®ããã« Conda ç°å¢ãã»ããã¢ããããããã®å æ¬çãªçŽ¹ä»ãããŸããCondaã¯ãªãŒãã³ãœãŒã¹ã®ããã±ãŒãžãšç°å¢ç®¡çã·ã¹ãã ã§ãããã±ãŒãžãšäŸåé¢ä¿ãã€ã³ã¹ããŒã«ããããã®pipã®åªãã代æ¿æ段ãæäŸããŸãããã®åé¢ãããç°å¢ã¯ãããŒã¿ãµã€ãšã³ã¹ãæ©æ¢°åŠç¿ã®åãçµã¿ã«ç¹ã«é©ããŠããŸãã詳现ã«ã€ããŠã¯ãAnacondaã®Ultralytics Conda ããã±ãŒãžãåç §ããGitHub ã®ããã±ãŒãžæŽæ°ã®ããã®Ultralytics feedstock ãªããžããªããã§ãã¯ããŠãã ããã
äœãåŠã¶ã
- Condaç°å¢ã®ã»ããã¢ãã
- Conda çµç±ã§Ultralytics ãã€ã³ã¹ããŒã«ãã
- Ultralytics ãã䜿ãã®ç°å¢ã§åæåãã
- Ultralytics Dockerã€ã¡ãŒãžãCondaã§äœ¿ã
åææ¡ä»¶
- ã䜿ãã®ã·ã¹ãã ã« Anaconda ãŸã㯠Miniconda ãã€ã³ã¹ããŒã«ãããŠããã¯ãã§ããã€ã³ã¹ããŒã«ãããŠããªãå Žåã¯ãAnacondaãŸãã¯Miniconda ããããŠã³ããŒãããŠã€ã³ã¹ããŒã«ããŠãã ããã
Condaç°å¢ã®ã»ããã¢ãã
ãŸããæ°ããCondaç°å¢ãäœããŸããããã¿ãŒããã«ãéãã以äžã®ã³ãã³ããå®è¡ããïŒ
æ°ããç°å¢ãã¢ã¯ãã£ãã«ããïŒ
ã€ã³ã¹ããŒã«Ultralytics
conda-forgeãã£ã³ãã«ããUltralytics ããã±ãŒãžãã€ã³ã¹ããŒã«ã§ããŸãã以äžã®ã³ãã³ããå®è¡ããŠãã ããïŒ
CUDA ç°å¢ã«ã€ããŠ
CUDA ã䜿ããç°å¢ã§äœæ¥ããŠããã®ã§ããã°ã以äžãã€ã³ã¹ããŒã«ããŠãããšããã ããã ultralytics
, pytorch
ãã㊠pytorch-cuda
ãããã察ç«ã解決ããããã«ååããïŒ
䜿çšUltralytics
Ultralytics ãã€ã³ã¹ããŒã«ããã°ããªããžã§ã¯ãæ€åºã ã€ã³ã¹ã¿ã³ã¹ã®ã»ã°ã¡ã³ããŒã·ã§ã³ãªã©ããã®ããã¹ããªæ©èœã䜿ãå§ããããšãã§ãããäŸãã°ãç»åãäºæž¬ããã«ã¯ã次ã®ããã«å®è¡ããŸãïŒ
from ultralytics import YOLO
model = YOLO("yolo11n.pt") # initialize model
results = model("path/to/image.jpg") # perform inference
results[0].show() # display results for the first image
Ultralytics Conda Dockerã€ã¡ãŒãž
Dockerã䜿ãããå Žåã¯ãUltralytics ãCondaç°å¢ãå«ãŸããDockerã€ã¡ãŒãžãæäŸããŠããããããã®ã€ã¡ãŒãžã¯DockerHubããåŒã£åŒµã£ãŠããããšãã§ããã
ææ°ã®Ultralytics ïŒ
# Set image name as a variable
t=ultralytics/ultralytics:latest-conda
# Pull the latest Ultralytics image from Docker Hub
sudo docker pull $t
ã€ã¡ãŒãžãå®è¡ããïŒ
# Run the Ultralytics image in a container with GPU support
sudo docker run -it --ipc=host --gpus all $t # all GPUs
sudo docker run -it --ipc=host --gpus '"device=2,3"' $t # specify GPUs
Libmambaã«ããã€ã³ã¹ããŒã«ã®é«éå
ããããªãã ããã±ãŒãžã€ã³ã¹ããŒã«ã®ã¹ããŒãã¢ãã ã䜿ãããšãã§ããŸãã libmamba
é«éã§ãã¯ãã¹ãã©ãããã©ãŒã ã§ãäŸåé¢ä¿ãæèããããã±ãŒãžãããŒãžã£ãŒã§ãããCondaã®ããã©ã«ãã®ä»£æ¿ãœã«ããŒãšããŠæ©èœããã
Libmamba ãæå¹ã«ããæ¹æ³
æå¹ã«ãã libmamba
ãCondaã®ãœã«ããŒãšããŠäœ¿çšããã«ã¯ã以äžã®æé ãå®è¡ããŸãïŒ
-
ãŸã
conda-libmamba-solver
ããã±ãŒãžã«è¿œå ããŸããCondaã®ããŒãžã§ã³ã4.11以äžã§ããã°ãããã¯ã¹ãããã§ããŸããlibmamba
ãããã©ã«ãã§å«ãŸããŠããã -
次ã«ãConda ã
libmamba
ããœã«ããŒãšããŠäœ¿çšããïŒ
ããã§çµããã§ãïŒããã§Condaã®ã€ã³ã¹ããŒã«ã¯ libmamba
ããœã«ããŒãšããŠäœ¿çšããããšã§ãããã±ãŒãžã®ã€ã³ã¹ããŒã«åŠçãéããªãã¯ãã ã
ããã§ãšãããããŸãïŒããªãã¯Condaç°å¢ã®ã»ããã¢ããã«æåããUltralytics ããã±ãŒãžãã€ã³ã¹ããŒã«ããŸãããããé«åºŠãªãã¥ãŒããªã¢ã«ãäŸã«ã€ããŠã¯ãUltralytics ã®ããã¥ã¡ã³ããåç §ããŠãã ããã
ããããã質å
Ultralytics ãããžã§ã¯ãã®ããã® Conda ç°å¢ã®ã»ããã¢ããæé ãæããŠãã ããã
Ultralytics ãããžã§ã¯ãçšã®Condaç°å¢ã®ã»ããã¢ããã¯ç°¡åã§ãã¹ã ãŒãºãªããã±ãŒãžç®¡çãä¿èšŒããããŸãã以äžã®ã³ãã³ãã䜿ã£ãŠæ°ããCondaç°å¢ãäœæããïŒ
ãããŠãæ°ããç°å¢ãã¢ã¯ãã£ãã«ããïŒ
æåŸã«ãconda-forgeãã£ã³ãã«ããUltralytics ïŒ
Ultralytics ãããžã§ã¯ãã®äŸåé¢ä¿ã管çããã®ã«ããªãpipã§ã¯ãªãCondaã䜿ãã¹ããªã®ã§ããããïŒ
Condaã¯å ç¢ãªããã±ãŒãžã»ç°å¢ç®¡çã·ã¹ãã ã§ãããpipãšæ¯èŒããŠããã€ãã®å©ç¹ããããäŸåé¢ä¿ãå¹ççã«ç®¡çããå¿ èŠãªã©ã€ãã©ãªã®äºææ§ãä¿èšŒãããCondaã®åé¢ãããç°å¢ã¯ãããŒã¿ãµã€ãšã³ã¹ãæ©æ¢°åŠç¿ãããžã§ã¯ãã«ãããŠéèŠãªããã±ãŒãžéã®ç«¶åãé²ããããã«ãCondaã¯ãã€ããªããã±ãŒãžã®é åžããµããŒãããã€ã³ã¹ããŒã«ããã»ã¹ãã¹ããŒãã¢ããããŸãã
CUDA ãæå¹ãªç°å¢ã§Ultralytics YOLO ã䜿çšããã°ãããé«éãªããã©ãŒãã³ã¹ãåŸãããŸããïŒ
ã¯ããCUDA-æå¹ãªç°å¢ãå©çšããããšã§ãããã©ãŒãã³ã¹ãåäžãããããšãã§ããŸãã以äžãã€ã³ã¹ããŒã«ããŠãã ããã ultralytics
, pytorch
ãã㊠pytorch-cuda
è¡çªãé¿ããããã«
ãã®ã»ããã¢ããã«ãããGPU ã¢ã¯ã»ã©ã¬ãŒã·ã§ã³ãå¯èœã«ãªãããã£ãŒãã©ãŒãã³ã°ã»ã¢ãã«ã®ãã¬ãŒãã³ã°ãæšè«ãªã©ã®éäžçãªã¿ã¹ã¯ã«äžå¯æ¬ ãšãªãã詳现ã«ã€ããŠã¯ãUltralytics ã€ã³ã¹ããŒã«ã¬ã€ããã芧ãã ããã
Condaç°å¢ã§Ultralytics Dockerã€ã¡ãŒãžã䜿çšããå©ç¹ã¯äœã§ããïŒ
Ultralytics Dockerã€ã¡ãŒãžã䜿çšããããšã§ãäžè²«æ§ã®ããåçŸå¯èœãªç°å¢ãä¿èšŒããããç§ã®ãã·ã³ã§ã¯åããã®ã«ããšããåé¡ããªããªããŸãããããã®ã€ã¡ãŒãžã«ã¯ãèšå®æžã¿ã®Condaç°å¢ãå«ãŸããŠãããã»ããã¢ããããã»ã¹ãç°¡çŽ åããŸãã以äžã®ã³ãã³ãã§ææ°ã®Ultralytics Dockerã€ã¡ãŒãžããã«ããŠå®è¡ããããšãã§ããŸãïŒ
sudo docker pull ultralytics/ultralytics:latest-conda
sudo docker run -it --ipc=host --gpus all ultralytics/ultralytics:latest-conda
ãã®ã¢ãããŒãã¯ãæ¬çªç°å¢ã§ã¢ããªã±ãŒã·ã§ã³ããããã€ããããè€éãªã¯ãŒã¯ãããŒãæåã§èšå®ããããšãªãå®è¡ããã®ã«çæ³çã§ããUltralytics Conda Docker Imageã®è©³çŽ°ã¯ãã¡ãã
Ultralytics ç°å¢ã§ Conda ããã±ãŒãžã®ã€ã³ã¹ããŒã«ãé«éåããã«ã¯ïŒ
ããã±ãŒãžã®ã€ã³ã¹ããŒã«ãé«éåããã«ã¯ libmamba
Condaçšã®é«éäŸåæ§ãœã«ããŒã§ããããŸã conda-libmamba-solver
ããã±ãŒãžã§æäŸãããïŒ
ã䜿çšããããã«ã³ã³ããèšå®ããã libmamba
ããœã«ããŒãšããŠäœ¿çšããïŒ
ãã®ã»ããã¢ããã¯ãããé«éã§å¹ççãªããã±ãŒãžç®¡çãæäŸãããç°å¢ãæé©åããããã®ãã³ãã¯ãlibmambaã®ã€ã³ã¹ããŒã«ãèªãã§ãã ããã