Advertisement
WareHouseHD
Oct 9th, 2024 (edited)
23
0
Never
This is comment for paste Detectron2 Dockerfile cuda124
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # 1. save this file into folder named: `docker` in the name `Dockerfile`
  2. # 2. install docker desktop (for windows)
  3. # 3. from `cmd` run:
  4.  
  5. cd docker
  6. docker build -t detectron2:v0 .
  7. docker run --gpus all -d --shm-size=12gb -p 5001:5001 --env="DISPLAY" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --name=detectron2 detectron2:v0
  8.  
  9.  
  10. # and to test is from your PC execute the command:
  11. curl -X POST -F "image=@path/to/your/input.jpg" http://localhost:5001/detect -o output.jpg
  12.  
  13.  
  14. -------------------------  Cheat-sheet:  ---------------------------
  15.  
  16. # Build:
  17. docker build -t detectron2:v0 .
  18.  
  19. # Launch new container from the built docker image (require GPUs):
  20. docker run --gpus all -it --shm-size=12gb -p 5001:5001 --env="DISPLAY" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" --name=detectron2 detectron2:v0
  21.  
  22. # launch the existing container:
  23. docker start detectron2
  24.  
  25. # Connect to the Container in Interactive Mode:
  26. docker exec -it detectron2 /bin/bash
  27.  
  28. # create a linux wheel file for detectron2:
  29. cd /home/tron2/detectron2_repo/
  30. python3 setup.py bdist_wheel
  31. # created file will be at:
  32. /home/tron2/detectron2_repo/dist/detectron2-0.6-cp311-cp311-linux_x86_64.whl
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement