11#! /bin/bash
2- # TODO: make sure python3 in host is OK
3- cd /tmp && \
4- git clone https://github.com/Seeed-Projects/jetson-examples && \
5- cd jetson-examples && \
6- pip install . && \
7- echo " reComputer installed. try 'reComputer run whisper' to enjoy!"
2+
3+ # Installation script for jetson-examples
4+ # Usage: curl -fsSL https://raw.githubusercontent.com/Seeed-Projects/jetson-examples/main/install.sh | bash
5+ set -e
6+
7+ # Color definitions
8+ RED=' \033[0;31m'
9+ GREEN=' \033[0;32m'
10+ YELLOW=' \033[1;33m'
11+ NC=' \033[0m' # No Color
12+
13+ echo -e " ${GREEN} ========================================${NC} "
14+ echo -e " ${GREEN} Jetson Examples Installation ${NC} "
15+ echo -e " ${GREEN} ========================================${NC} "
16+ echo " "
17+
18+ # Check Python3
19+ if ! command -v python3 & > /dev/null; then
20+ echo -e " ${RED} Error: Python3 is not installed${NC} "
21+ echo " Please install Python3 first:"
22+ echo " sudo apt update && sudo apt install -y python3 python3-pip"
23+ exit 1
24+ fi
25+
26+ PYTHON_VERSION=$( python3 --version | cut -d' ' -f2)
27+ echo -e " ${GREEN} ✓${NC} Python3 found: $PYTHON_VERSION "
28+
29+ # Check pip
30+ if ! command -v pip3 & > /dev/null && ! command -v pip & > /dev/null; then
31+ echo -e " ${YELLOW} Installing pip3...${NC} "
32+ sudo apt update
33+ sudo apt install -y python3-pip
34+ fi
35+
36+ # Check if running on Jetson (optional but recommended)
37+ if [ -f " /proc/device-tree/model" ]; then
38+ MODEL=$( tr -d ' \0' < /proc/device-tree/model)
39+ echo -e " ${GREEN} ✓${NC} Jetson device detected: $MODEL "
40+ else
41+ echo -e " ${YELLOW} ⚠ Warning: Not running on a Jetson device${NC} "
42+ read -p " Continue installation anyway? (y/N): " -n 1 -r
43+ echo
44+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
45+ exit 1
46+ fi
47+ fi
48+
49+ # Create temp directory for installation
50+ TEMP_DIR=$( mktemp -d)
51+ trap " rm -rf $TEMP_DIR " EXIT
52+
53+ echo " "
54+ echo " Downloading jetson-examples..."
55+ cd " $TEMP_DIR "
56+
57+ # Clone the repository
58+ REPO_URL=" ${JETSON_EXAMPLES_REPO:- https:// github.com/ Seeed-Projects/ jetson-examples} "
59+ echo " Repository: $REPO_URL "
60+
61+ if ! git clone --depth=1 " $REPO_URL " ; then
62+ echo -e " ${RED} Error: Failed to clone repository${NC} "
63+ exit 1
64+ fi
65+
66+ cd jetson-examples
67+
68+ # Install the package
69+ echo " "
70+ echo " Installing jetson-examples..."
71+ if pip3 install --user . ; then
72+ echo " "
73+ echo -e " ${GREEN} ========================================${NC} "
74+ echo -e " ${GREEN} Installation Completed! ${NC} "
75+ echo -e " ${GREEN} ========================================${NC} "
76+ echo " "
77+ echo " reComputer has been installed successfully!"
78+ echo " "
79+ echo " Getting started:"
80+ echo " reComputer help - Show available commands"
81+ echo " reComputer check - Check system compatibility"
82+ echo " reComputer setup - Setup environment"
83+ echo " reComputer list - List available examples"
84+ echo " reComputer run llava - Run an example"
85+ echo " "
86+ echo -e " ${GREEN} Enjoy using jetson-examples!${NC} "
87+ else
88+ echo -e " ${RED} Error: Installation failed${NC} "
89+ echo " Please check the error messages above"
90+ exit 1
91+ fi
0 commit comments