Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

install_openpose.sh 2.3 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
  1. #!/bin/bash
  2. echo "------------------------- Installing OpenPose -------------------------"
  3. echo "NOTE: This script assumes that CUDA and cuDNN are already installed on your machine. Otherwise, it might fail."
  4. function exitIfError {
  5. if [[ $? -ne 0 ]] ; then
  6. echo ""
  7. echo "------------------------- -------------------------"
  8. echo "Errors detected. Exiting script. The software might have not been successfully installed."
  9. echo "------------------------- -------------------------"
  10. exit 1
  11. fi
  12. }
  13. function executeShInItsFolder {
  14. # $1 = sh file name
  15. # $2 = folder where the sh file is
  16. # $3 = folder to go back
  17. cd $2
  18. exitIfError
  19. sudo chmod +x $1
  20. exitIfError
  21. ./$1
  22. exitIfError
  23. cd $3
  24. exitIfError
  25. }
  26. echo "------------------------- Checking Ubuntu Version -------------------------"
  27. ubuntu_version="$(lsb_release -r)"
  28. echo "Ubuntu $ubuntu_version"
  29. if [[ $ubuntu_version == *"14."* ]]; then
  30. ubuntu_le_14=true
  31. elif [[ $ubuntu_version == *"16."* || $ubuntu_version == *"15."* || $ubuntu_version == *"17."* || $ubuntu_version == *"18."* ]]; then
  32. ubuntu_le_14=false
  33. else
  34. echo "Ubuntu release older than version 14. This installation script might fail."
  35. ubuntu_le_14=true
  36. fi
  37. exitIfError
  38. echo "------------------------- Ubuntu Version Checked -------------------------"
  39. echo ""
  40. echo "------------------------- Checking Number of Processors -------------------------"
  41. NUM_CORES=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu)
  42. echo "$NUM_CORES cores"
  43. exitIfError
  44. echo "------------------------- Number of Processors Checked -------------------------"
  45. echo ""
  46. echo "------------------------- Compiling OpenPose -------------------------"
  47. if [[ $ubuntu_le_14 == true ]]; then
  48. cp Makefile.config.Ubuntu14.example Makefile.config
  49. else
  50. cp Makefile.config.Ubuntu16.example Makefile.config
  51. fi
  52. make all -j$NUM_CORES
  53. exitIfError
  54. echo "------------------------- OpenPose Compiled -------------------------"
  55. echo ""
  56. echo "------------------------- Downloading OpenPose Models -------------------------"
  57. executeShInItsFolder "getModels.sh" "./models" ".."
  58. exitIfError
  59. echo "Models downloaded"
  60. echo "------------------------- OpenPose Models Downloaded -------------------------"
  61. echo ""
  62. echo "------------------------- OpenPose Installed -------------------------"
  63. echo ""
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...