jetson-examples 0.0.2__py3-none-any.whl → 0.0.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {jetson_examples-0.0.2.dist-info → jetson_examples-0.0.4.dist-info}/METADATA +8 -5
- jetson_examples-0.0.4.dist-info/RECORD +12 -0
- reComputer/__init__.py +1 -0
- reComputer/main.py +6 -19
- reComputer/scripts/check.sh +5 -0
- reComputer/scripts/live-llava.sh +278 -0
- reComputer/scripts/nanodb.sh +66 -0
- {jetson_examples-0.0.2.data/data → reComputer}/scripts/run.sh +13 -69
- jetson_examples-0.0.2.dist-info/RECORD +0 -9
- {jetson_examples-0.0.2.dist-info → jetson_examples-0.0.4.dist-info}/LICENSE +0 -0
- {jetson_examples-0.0.2.dist-info → jetson_examples-0.0.4.dist-info}/WHEEL +0 -0
- {jetson_examples-0.0.2.dist-info → jetson_examples-0.0.4.dist-info}/entry_points.txt +0 -0
- {jetson_examples-0.0.2.dist-info → jetson_examples-0.0.4.dist-info}/top_level.txt +0 -0
@@ -1,10 +1,11 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: jetson-examples
|
3
|
-
Version: 0.0.
|
4
|
-
Summary:
|
3
|
+
Version: 0.0.4
|
4
|
+
Summary: Running Gen AI models and applications on NVIDIA Jetson devices with one-line command
|
5
5
|
Author-email: luozhixin <zhixin.luo@seeed.cc>
|
6
6
|
Project-URL: Homepage, https://github.com/Seeed-Projects/jetson-examples
|
7
7
|
Project-URL: Issues, https://github.com/Seeed-Projects/jetson-examples/issues
|
8
|
+
Keywords: llama,llava,gpt,llm,nvidia,jetson,multimodal,jetson orin
|
8
9
|
Classifier: Programming Language :: Python :: 3
|
9
10
|
Classifier: License :: OSI Approved :: MIT License
|
10
11
|
Classifier: Operating System :: OS Independent
|
@@ -13,15 +14,17 @@ Description-Content-Type: text/markdown
|
|
13
14
|
License-File: LICENSE
|
14
15
|
|
15
16
|
<div align="center">
|
16
|
-
<img alt="jetson"
|
17
|
+
<img alt="jetson" width="1200px" src="https://files.seeedstudio.com/wiki/reComputer-Jetson/jetson-examples/Jetson1200x300.png">
|
17
18
|
</div>
|
18
19
|
|
19
20
|
# jetson-examples
|
20
21
|
|
21
22
|
[](https://discord.gg/5BQCkty7vN)
|
22
23
|
|
23
|
-
|
24
|
-
|
24
|
+
This repository provides examples for running AI models and applications on NVIDIA Jetson devices. For generative AI, it supports a variety of examples including text generation, image generation, vision transformers, vector databases, and audio models.
|
25
|
+
To run the examples, you need to install the jetson-examples package and use the Seeed Studio [reComputer](https://www.seeedstudio.com/reComputer-J4012-p-5586.html), the edge AI device powered by Jetson Orin. The repo aims to make it easy to deploy state-of-the-art AI models, with just one line of command, on Jetson devices for tasks like language understanding, computer vision, and multimodal processing.
|
26
|
+
|
27
|
+
This repo builds upon the work of the [Jetson Containers](https://github.com/dusty-nv/jetson-containers), which provides a modular container build system for various AI/ML packages on NVIDIA Jetson devices. It also leverages resources and tutorials from the [Jetson Generative AI Lab](https://www.jetson-ai-lab.com/index.html), which showcases bringing generative AI to the edge, powered by Jetson hardware.
|
25
28
|
|
26
29
|
## Install
|
27
30
|
|
@@ -0,0 +1,12 @@
|
|
1
|
+
reComputer/__init__.py,sha256=1mptEzQihbdyqqzMgdns_j5ZGK9gz7hR2bsgA_TnjO4,22
|
2
|
+
reComputer/main.py,sha256=TRhzH30lOSPyWyAHSjlSe40BL2nBRz5-a5zQoRr595A,809
|
3
|
+
reComputer/scripts/check.sh,sha256=cUMwAjHpgJoaD5a8gTLJG7QWjF9CyKPgQ-ewRNK3FD8,127
|
4
|
+
reComputer/scripts/live-llava.sh,sha256=4sWld5d8Fkr9GUVqLH2S1RyOKOjobhjojSzuJu8EuCg,10137
|
5
|
+
reComputer/scripts/nanodb.sh,sha256=6MKQgYqDhg-Rvh3Sk4sNm5V2jg1ZgtSVvB2fOjH_KuE,1875
|
6
|
+
reComputer/scripts/run.sh,sha256=hVRRC-wwjrfUdwSIg_0XDlKWNcVq_CfVBZOReddJ7Ek,3585
|
7
|
+
jetson_examples-0.0.4.dist-info/LICENSE,sha256=ac_LOi8ChcJhymEfBulX98Y06wTI2IMcQnqCXZ5yay4,1066
|
8
|
+
jetson_examples-0.0.4.dist-info/METADATA,sha256=FZkx_NFvQOVHNyAv8GIaq-WwIISYe_3pHGg1ZyfvVK8,3903
|
9
|
+
jetson_examples-0.0.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
10
|
+
jetson_examples-0.0.4.dist-info/entry_points.txt,sha256=5-OdcBifoDjVXE9KjNoN6tQa8l_XSXhdbBEgL2hxeDM,58
|
11
|
+
jetson_examples-0.0.4.dist-info/top_level.txt,sha256=SI-liiUOkoGwOJfMP7d7k63JKgdcbiEj6DEC8QIKI90,11
|
12
|
+
jetson_examples-0.0.4.dist-info/RECORD,,
|
reComputer/__init__.py
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.0.4"
|
reComputer/main.py
CHANGED
@@ -3,40 +3,27 @@ import subprocess
|
|
3
3
|
import sys
|
4
4
|
|
5
5
|
|
6
|
-
def
|
7
|
-
script_path = os.path.
|
8
|
-
|
9
|
-
print("installation_path:", installation_path)
|
10
|
-
return installation_path
|
6
|
+
def script(name):
|
7
|
+
script_path = os.path.join(os.path.dirname(__file__), "scripts", name)
|
8
|
+
return script_path
|
11
9
|
|
12
10
|
|
13
11
|
def run_script():
|
14
12
|
# TODO: maybe use python instead of shell is better
|
15
13
|
if len(sys.argv) == 3:
|
16
14
|
if sys.argv[1] == "run":
|
17
|
-
|
15
|
+
example_name = sys.argv[2]
|
16
|
+
subprocess.run(["bash", script("run.sh"), example_name])
|
18
17
|
else:
|
19
18
|
print("Only Support `run` for now. try `reComputer run llava` .")
|
20
19
|
elif len(sys.argv) == 2:
|
21
20
|
if sys.argv[1] == "check":
|
22
|
-
check
|
21
|
+
subprocess.run(["bash", script("check.sh")])
|
23
22
|
else:
|
24
23
|
print("Only Support `check` for now. try `reComputer check` .")
|
25
24
|
else:
|
26
25
|
print("Error Usage! try `reComputer run xxx` .")
|
27
26
|
|
28
27
|
|
29
|
-
def run_example():
|
30
|
-
installation_path = get_installation_path()
|
31
|
-
runner_script = os.path.join(installation_path, "..", "scripts", "run.sh")
|
32
|
-
subprocess.run(["bash", runner_script, sys.argv[2]])
|
33
|
-
|
34
|
-
|
35
|
-
def check():
|
36
|
-
# TODO: do some real check
|
37
|
-
subprocess.run(["python", "-V"])
|
38
|
-
subprocess.run(["python3", "-V"])
|
39
|
-
|
40
|
-
|
41
28
|
if __name__ == "__main__":
|
42
29
|
pass
|
@@ -0,0 +1,278 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
SUPPORT_L4T_LIST="35.3.1"
|
4
|
+
BASE_PATH=/home/$USER/reComputer
|
5
|
+
JETSON_REPO_PATH="$BASE_PATH/jetson-containers"
|
6
|
+
|
7
|
+
get_l4t_version() {
|
8
|
+
ARCH=$(uname -i)
|
9
|
+
echo "ARCH: $ARCH"
|
10
|
+
|
11
|
+
if [ $ARCH = "aarch64" ]; then
|
12
|
+
L4T_VERSION_STRING=$(head -n 1 /etc/nv_tegra_release)
|
13
|
+
|
14
|
+
if [ -z "$L4T_VERSION_STRING" ]; then
|
15
|
+
echo "reading L4T version from \"dpkg-query --show nvidia-l4t-core\""
|
16
|
+
L4T_VERSION_STRING=$(dpkg-query --showformat='${Version}' --show nvidia-l4t-core)
|
17
|
+
L4T_VERSION_ARRAY=(${L4T_VERSION_STRING//./ })
|
18
|
+
L4T_RELEASE=${L4T_VERSION_ARRAY[0]}
|
19
|
+
L4T_REVISION=${L4T_VERSION_ARRAY[1]}
|
20
|
+
else
|
21
|
+
echo "reading L4T version from /etc/nv_tegra_release"
|
22
|
+
L4T_RELEASE=$(echo $L4T_VERSION_STRING | cut -f 2 -d ' ' | grep -Po '(?<=R)[^;]+')
|
23
|
+
L4T_REVISION=$(echo $L4T_VERSION_STRING | cut -f 2 -d ',' | grep -Po '(?<=REVISION: )[^;]+')
|
24
|
+
fi
|
25
|
+
|
26
|
+
L4T_REVISION_MAJOR=${L4T_REVISION:0:1}
|
27
|
+
L4T_REVISION_MINOR=${L4T_REVISION:2:1}
|
28
|
+
L4T_VERSION="$L4T_RELEASE.$L4T_REVISION"
|
29
|
+
|
30
|
+
echo "L4T_VERSION: $L4T_VERSION"
|
31
|
+
|
32
|
+
elif [ $ARCH != "x86_64" ]; then
|
33
|
+
echo "unsupported architecture: $ARCH" # show in red color
|
34
|
+
exit 1
|
35
|
+
fi
|
36
|
+
}
|
37
|
+
|
38
|
+
# 1. Check L4T version
|
39
|
+
get_l4t_version
|
40
|
+
CHECK_L4T_VERSION=0
|
41
|
+
for item in $SUPPORT_L4T_LIST; do
|
42
|
+
if [ "$item" = "$L4T_VERSION" ]; then
|
43
|
+
CHECK_L4T_VERSION=1
|
44
|
+
break
|
45
|
+
fi
|
46
|
+
done
|
47
|
+
|
48
|
+
if [ $CHECK_L4T_VERSION -eq 1 ]; then
|
49
|
+
echo "pass the version check"
|
50
|
+
else
|
51
|
+
echo "currently supported versions of jetpack are $SUPPORT_L4T_LIST" # show in red color
|
52
|
+
exit 1
|
53
|
+
fi
|
54
|
+
|
55
|
+
# 2. Check Google Chrome
|
56
|
+
if dpkg -s chromium-browser &>/dev/null; then
|
57
|
+
echo "Chrome is installed."
|
58
|
+
else
|
59
|
+
echo "install Google Chrome ..." # show in red color
|
60
|
+
sudo apt install chromium-browser
|
61
|
+
echo "Google Chrome installed successfully" # show in red color
|
62
|
+
fi
|
63
|
+
|
64
|
+
# 3. Generate Google browser key
|
65
|
+
FILE_NAME="key.pem"
|
66
|
+
FILE_PATH="$JETSON_REPO_PATH/data"
|
67
|
+
if [ -f "$FILE_PATH/$FILE_NAME" ]; then
|
68
|
+
echo "key file '$FILE_PATH/$FILE_NAME' exists."
|
69
|
+
else
|
70
|
+
cd $FILE_PATH
|
71
|
+
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 -nodes -subj '/CN=localhost'
|
72
|
+
cd ..
|
73
|
+
fi
|
74
|
+
|
75
|
+
# 4. edit source code
|
76
|
+
cat >"$JETSON_REPO_PATH/packages/llm/local_llm/agents/video_query.py" <<'EOF'
|
77
|
+
#!/usr/bin/env python3
|
78
|
+
import time
|
79
|
+
import logging
|
80
|
+
import threading
|
81
|
+
|
82
|
+
from local_llm import Agent
|
83
|
+
|
84
|
+
from local_llm.plugins import (
|
85
|
+
VideoSource,
|
86
|
+
VideoOutput,
|
87
|
+
ChatQuery,
|
88
|
+
PrintStream,
|
89
|
+
ProcessProxy,
|
90
|
+
)
|
91
|
+
from local_llm.utils import ArgParser, print_table
|
92
|
+
|
93
|
+
from termcolor import cprint
|
94
|
+
from jetson_utils import cudaFont, cudaMemcpy, cudaToNumpy, cudaDeviceSynchronize
|
95
|
+
|
96
|
+
from flask import Flask, request
|
97
|
+
|
98
|
+
|
99
|
+
class VideoQuery(Agent):
|
100
|
+
"""
|
101
|
+
Perpetual always-on closed-loop visual agent that applies prompts to a video stream.
|
102
|
+
"""
|
103
|
+
|
104
|
+
def __init__(self, model="liuhaotian/llava-v1.5-7b", **kwargs):
|
105
|
+
super().__init__()
|
106
|
+
self.lock = threading.Lock()
|
107
|
+
|
108
|
+
# load model in another process for smooth streaming
|
109
|
+
# self.llm = ProcessProxy((lambda **kwargs: ChatQuery(model, drop_inputs=True, **kwargs)), **kwargs)
|
110
|
+
self.llm = ChatQuery(model, drop_inputs=True, **kwargs)
|
111
|
+
self.llm.add(PrintStream(color="green", relay=True).add(self.on_text))
|
112
|
+
self.llm.start()
|
113
|
+
|
114
|
+
# test / warm-up query
|
115
|
+
self.warmup = True
|
116
|
+
self.text = ""
|
117
|
+
self.eos = False
|
118
|
+
|
119
|
+
self.llm("What is 2+2?")
|
120
|
+
|
121
|
+
while self.warmup:
|
122
|
+
time.sleep(0.25)
|
123
|
+
|
124
|
+
# create video streams
|
125
|
+
self.video_source = VideoSource(**kwargs)
|
126
|
+
self.video_output = VideoOutput(**kwargs)
|
127
|
+
|
128
|
+
self.video_source.add(self.on_video, threaded=False)
|
129
|
+
self.video_output.start()
|
130
|
+
|
131
|
+
self.font = cudaFont()
|
132
|
+
|
133
|
+
# setup prompts
|
134
|
+
self.prompt = "Describe the image concisely and briefly."
|
135
|
+
|
136
|
+
# entry node
|
137
|
+
self.pipeline = [self.video_source]
|
138
|
+
|
139
|
+
def on_video(self, image):
|
140
|
+
np_image = cudaToNumpy(image)
|
141
|
+
cudaDeviceSynchronize()
|
142
|
+
|
143
|
+
self.llm(
|
144
|
+
[
|
145
|
+
"reset",
|
146
|
+
np_image,
|
147
|
+
self.prompt,
|
148
|
+
]
|
149
|
+
)
|
150
|
+
|
151
|
+
text = self.text.replace("\n", "").replace("</s>", "").strip()
|
152
|
+
|
153
|
+
if text:
|
154
|
+
worlds = text.split()
|
155
|
+
line_counter = len(worlds) // 10
|
156
|
+
if len(worlds) % 10 != 0:
|
157
|
+
line_counter += 1
|
158
|
+
for l in range(line_counter):
|
159
|
+
line_text = " ".join(worlds[l * 10 : (l + 1) * 10])
|
160
|
+
self.font.OverlayText(
|
161
|
+
image,
|
162
|
+
text=line_text,
|
163
|
+
x=5,
|
164
|
+
y=int(79 + l * 37),
|
165
|
+
color=self.font.White,
|
166
|
+
background=self.font.Gray40,
|
167
|
+
)
|
168
|
+
self.font.OverlayText(
|
169
|
+
image,
|
170
|
+
text="Prompt: " + self.prompt,
|
171
|
+
x=5,
|
172
|
+
y=42,
|
173
|
+
color=(120, 215, 21),
|
174
|
+
background=self.font.Gray40,
|
175
|
+
)
|
176
|
+
self.video_output(image)
|
177
|
+
|
178
|
+
def on_text(self, text):
|
179
|
+
if self.eos:
|
180
|
+
self.text = text # new query response
|
181
|
+
self.eos = False
|
182
|
+
elif not self.warmup: # don't view warmup response
|
183
|
+
self.text = self.text + text
|
184
|
+
|
185
|
+
if text.endswith("</s>") or text.endswith("###") or text.endswith("<|im_end|>"):
|
186
|
+
self.print_stats()
|
187
|
+
self.warmup = False
|
188
|
+
self.eos = True
|
189
|
+
|
190
|
+
def update_switch(self, on_off):
|
191
|
+
self.video_source.switch(on_off)
|
192
|
+
|
193
|
+
def update_prompts(self, new_prompt):
|
194
|
+
with self.lock:
|
195
|
+
if new_prompt:
|
196
|
+
self.prompt = new_prompt
|
197
|
+
|
198
|
+
def print_stats(self):
|
199
|
+
# print_table(self.llm.model.stats)
|
200
|
+
curr_time = time.perf_counter()
|
201
|
+
|
202
|
+
if not hasattr(self, "start_time"):
|
203
|
+
self.start_time = curr_time
|
204
|
+
else:
|
205
|
+
frame_time = curr_time - self.start_time
|
206
|
+
self.start_time = curr_time
|
207
|
+
logging.info(
|
208
|
+
f"refresh rate: {1.0 / frame_time:.2f} FPS ({frame_time*1000:.1f} ms)"
|
209
|
+
)
|
210
|
+
|
211
|
+
|
212
|
+
if __name__ == "__main__":
|
213
|
+
parser = ArgParser(extras=ArgParser.Defaults + ["video_input", "video_output"])
|
214
|
+
args = parser.parse_args()
|
215
|
+
# 独立线程运行
|
216
|
+
agent = VideoQuery(**vars(args))
|
217
|
+
|
218
|
+
def run_video_query():
|
219
|
+
agent.run()
|
220
|
+
|
221
|
+
video_query_thread = threading.Thread(target=run_video_query)
|
222
|
+
video_query_thread.start()
|
223
|
+
|
224
|
+
# 启动web服务
|
225
|
+
app = Flask(__name__)
|
226
|
+
|
227
|
+
@app.route("/update_prompt", methods=["POST"])
|
228
|
+
def update_prompts():
|
229
|
+
prompt = request.json.get("prompt")
|
230
|
+
if prompt:
|
231
|
+
agent.update_prompts(prompt)
|
232
|
+
return "Prompts updated successfully."
|
233
|
+
else:
|
234
|
+
return "Invalid prompts data."
|
235
|
+
|
236
|
+
@app.route("/update_switch", methods=["POST"])
|
237
|
+
def update_switch():
|
238
|
+
infer_or_not = True if request.json.get("switch") == "on" else False
|
239
|
+
agent.update_switch(infer_or_not)
|
240
|
+
return "stop" if not infer_or_not else "start"
|
241
|
+
|
242
|
+
@app.route("/update_params", methods=["POST"])
|
243
|
+
def update_params():
|
244
|
+
try:
|
245
|
+
agent.llm.max_new_tokens = request.json.get("max_new_tokens") or 128
|
246
|
+
agent.llm.min_new_tokens = request.json.get("min_new_tokens") or -1
|
247
|
+
agent.llm.do_sample = request.json.get("do_sample") or False
|
248
|
+
agent.llm.repetition_penalty = request.json.get("repetition_penalty") or 1.0
|
249
|
+
agent.llm.temperature = request.json.get("temperature") or 0.7
|
250
|
+
agent.llm.top_p = request.json.get("top_p") or 0.95
|
251
|
+
if request.json.get("system_prompt"):
|
252
|
+
agent.llm.chat_history.template["system_prompt"] = request.json.get(
|
253
|
+
"system_prompt"
|
254
|
+
)
|
255
|
+
return "params updated."
|
256
|
+
except Exception as e:
|
257
|
+
print(e)
|
258
|
+
return "update failure"
|
259
|
+
|
260
|
+
app.run(host="0.0.0.0", port=5555)
|
261
|
+
|
262
|
+
|
263
|
+
EOF
|
264
|
+
|
265
|
+
sed -i 's/from transformers import CLIPImageProcessor, CLIPVisionModelWithProjection, SiglipImageProcessor, SiglipVisionModel/from transformers import CLIPImageProcessor, CLIPVisionModelWithProjection # , SiglipImageProcessor, SiglipVisionModel/' "$JETSON_REPO_PATH/packages/llm/local_llm/vision/clip_hf.py"
|
266
|
+
sed -i "s/'siglip': dict(preprocessor=SiglipImageProcessor, model=SiglipVisionModel),/# 'siglip': dict(preprocessor=SiglipImageProcessor, model=SiglipVisionModel),/" "$JETSON_REPO_PATH/packages/llm/local_llm/vision/clip_hf.py"
|
267
|
+
|
268
|
+
sed -i 's/from .audio import */# from .audio import */' "$JETSON_REPO_PATH/packages/llm/local_llm/plugins/__init__.py"
|
269
|
+
sed -i 's/from .nanodb import NanoDB/# from .nanodb import NanoDB/' "$JETSON_REPO_PATH/packages/llm/local_llm/plugins/__init__.py"
|
270
|
+
|
271
|
+
sed -i 's/import onnxruntime as ort/# import onnxruntime as ort/' "$JETSON_REPO_PATH/packages/llm/local_llm/utils/model.py"
|
272
|
+
|
273
|
+
echo "The script has been modified."
|
274
|
+
|
275
|
+
gnome-terminal -- /bin/bash -c "chromium-browser --disable-features=WebRtcHideLocalIpsWithMdns https://localhost:8554/; exec /bin/bash"
|
276
|
+
|
277
|
+
cd $JETSON_REPO_PATH
|
278
|
+
sudo docker run --runtime nvidia -it --rm --network host --volume /tmp/argus_socket:/tmp/argus_socket --volume /etc/enctune.conf:/etc/enctune.conf --volume /etc/nv_tegra_release:/etc/nv_tegra_release --volume /proc/device-tree/model:/tmp/nv_jetson_model --volume /var/run/dbus:/var/run/dbus --volume /var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket --volume /var/run/docker.sock:/var/run/docker.sock --volume $JETSON_REPO_PATH/data:/data --device /dev/snd --device /dev/bus/usb -e DISPLAY=:0 -v /tmp/.X11-unix/:/tmp/.X11-unix -v /tmp/.docker.xauth:/tmp/.docker.xauth -e XAUTHORITY=/tmp/.docker.xauth --device /dev/video0 --device /dev/video1 -v $JETSON_REPO_PATH/packages/llm/local_llm:/opt/local_llm/local_llm -e SSL_KEY=/data/key.pem -e SSL_CERT=/data/cert.pem dustynv/local_llm:r35.3.1 python3 -m local_llm.agents.video_query --api=mlc --verbose --model liuhaotian/llava-v1.5-7b --max-new-tokens 32 --video-input /dev/video0 --video-output webrtc://@:8554/output
|
@@ -0,0 +1,66 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
BASE_PATH=/home/$USER/reComputer
|
4
|
+
JETSON_REPO_PATH="$BASE_PATH/jetson-containers"
|
5
|
+
|
6
|
+
# check data files TODO: support params to force download
|
7
|
+
DATA_PATH="$JETSON_REPO_PATH/data/datasets/coco/2017"
|
8
|
+
if [ ! -d $DATA_PATH ]; then
|
9
|
+
mkdir -p $DATA_PATH
|
10
|
+
fi
|
11
|
+
cd $DATA_PATH
|
12
|
+
# check val2017.zip
|
13
|
+
if [ ! -d "$DATA_PATH/val2017" ]; then
|
14
|
+
if [ ! -f "val2017.zip" ]; then
|
15
|
+
check_disk_space $DATA_PATH 1
|
16
|
+
wget http://images.cocodataset.org/zips/val2017.zip
|
17
|
+
else
|
18
|
+
echo "val2017.zip existed."
|
19
|
+
fi
|
20
|
+
check_disk_space $DATA_PATH 19
|
21
|
+
unzip val2017.zip && rm val2017.zip
|
22
|
+
else
|
23
|
+
echo "val2017/ existed."
|
24
|
+
fi
|
25
|
+
# check train2017.zip
|
26
|
+
if [ ! -d "$DATA_PATH/train2017" ]; then
|
27
|
+
if [ ! -f "train2017.zip" ]; then
|
28
|
+
check_disk_space $DATA_PATH 19
|
29
|
+
wget http://images.cocodataset.org/zips/train2017.zip
|
30
|
+
else
|
31
|
+
echo "train2017.zip existed."
|
32
|
+
fi
|
33
|
+
check_disk_space $DATA_PATH 19
|
34
|
+
unzip train2017.zip && rm train2017.zip
|
35
|
+
else
|
36
|
+
echo "train2017/ existed."
|
37
|
+
fi
|
38
|
+
if [ ! -d "$DATA_PATH/unlabeled2017" ]; then
|
39
|
+
# check unlabeled2017.zip
|
40
|
+
if [ ! -f "unlabeled2017.zip" ]; then
|
41
|
+
check_disk_space $DATA_PATH 19
|
42
|
+
wget http://images.cocodataset.org/zips/unlabeled2017.zip
|
43
|
+
else
|
44
|
+
echo "unlabeled2017.zip existed."
|
45
|
+
fi
|
46
|
+
check_disk_space $DATA_PATH 19
|
47
|
+
unzip unlabeled2017.zip && rm unlabeled2017.zip
|
48
|
+
else
|
49
|
+
echo "unlabeled2017/ existed."
|
50
|
+
fi
|
51
|
+
|
52
|
+
# check index files
|
53
|
+
INDEX_PATH="$JETSON_REPO_PATH/data/nanodb/coco/2017"
|
54
|
+
if [ ! -d $INDEX_PATH ]; then
|
55
|
+
cd $JETSON_REPO_PATH/data/
|
56
|
+
check_disk_space $JETSON_REPO_PATH 1
|
57
|
+
wget https://nvidia.box.com/shared/static/icw8qhgioyj4qsk832r4nj2p9olsxoci.gz -O nanodb_coco_2017.tar.gz
|
58
|
+
tar -xzvf nanodb_coco_2017.tar.gz
|
59
|
+
fi
|
60
|
+
|
61
|
+
# RUN
|
62
|
+
cd $JETSON_REPO_PATH
|
63
|
+
./run.sh $(./autotag nanodb) \
|
64
|
+
python3 -m nanodb \
|
65
|
+
--path /data/nanodb/coco/2017 \
|
66
|
+
--server --port=7860
|
@@ -2,18 +2,17 @@
|
|
2
2
|
|
3
3
|
check_is_jetson_or_not() {
|
4
4
|
model_file="/proc/device-tree/model"
|
5
|
-
|
6
|
-
if [ -f "
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
echo "INFO: jetson machine confirmed..."
|
5
|
+
|
6
|
+
if [ -f "/proc/device-tree/model" ]; then
|
7
|
+
model=$(tr -d '\0' < /proc/device-tree/model | tr '[:upper:]' '[:lower:]')
|
8
|
+
if [[ $model =~ jetson|orin|nv|agx ]]; then
|
9
|
+
echo "INFO: machine[$model] confirmed..."
|
11
10
|
else
|
12
|
-
echo "WARNING:
|
11
|
+
echo "WARNING: machine[$model] maybe not support..."
|
13
12
|
exit 1
|
14
13
|
fi
|
15
14
|
else
|
16
|
-
echo "ERROR:
|
15
|
+
echo "ERROR: machine[$model] not support this..."
|
17
16
|
exit 1
|
18
17
|
fi
|
19
18
|
}
|
@@ -103,67 +102,12 @@ case "$1" in
|
|
103
102
|
./run.sh $(./autotag whisper)
|
104
103
|
;;
|
105
104
|
"nanodb")
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
# check val2017.zip
|
113
|
-
if [ ! -d "$DATA_PATH/val2017" ]; then
|
114
|
-
if [ ! -f "val2017.zip" ]; then
|
115
|
-
check_disk_space $DATA_PATH 1
|
116
|
-
wget http://images.cocodataset.org/zips/val2017.zip
|
117
|
-
else
|
118
|
-
echo "val2017.zip existed."
|
119
|
-
fi
|
120
|
-
check_disk_space $DATA_PATH 19
|
121
|
-
unzip val2017.zip && rm val2017.zip
|
122
|
-
else
|
123
|
-
echo "val2017/ existed."
|
124
|
-
fi
|
125
|
-
# check train2017.zip
|
126
|
-
if [ ! -d "$DATA_PATH/train2017" ]; then
|
127
|
-
if [ ! -f "train2017.zip" ]; then
|
128
|
-
check_disk_space $DATA_PATH 19
|
129
|
-
wget http://images.cocodataset.org/zips/train2017.zip
|
130
|
-
else
|
131
|
-
echo "train2017.zip existed."
|
132
|
-
fi
|
133
|
-
check_disk_space $DATA_PATH 19
|
134
|
-
unzip train2017.zip && rm train2017.zip
|
135
|
-
else
|
136
|
-
echo "train2017/ existed."
|
137
|
-
fi
|
138
|
-
if [ ! -d "$DATA_PATH/unlabeled2017" ]; then
|
139
|
-
# check unlabeled2017.zip
|
140
|
-
if [ ! -f "unlabeled2017.zip" ]; then
|
141
|
-
check_disk_space $DATA_PATH 19
|
142
|
-
wget http://images.cocodataset.org/zips/unlabeled2017.zip
|
143
|
-
else
|
144
|
-
echo "unlabeled2017.zip existed."
|
145
|
-
fi
|
146
|
-
check_disk_space $DATA_PATH 19
|
147
|
-
unzip unlabeled2017.zip && rm unlabeled2017.zip
|
148
|
-
else
|
149
|
-
echo "unlabeled2017/ existed."
|
150
|
-
fi
|
151
|
-
|
152
|
-
# check index files
|
153
|
-
INDEX_PATH="$JETSON_REPO_PATH/data/nanodb/coco/2017"
|
154
|
-
if [ ! -d $INDEX_PATH ]; then
|
155
|
-
cd $JETSON_REPO_PATH/data/
|
156
|
-
check_disk_space $JETSON_REPO_PATH 1
|
157
|
-
wget https://nvidia.box.com/shared/static/icw8qhgioyj4qsk832r4nj2p9olsxoci.gz -O nanodb_coco_2017.tar.gz
|
158
|
-
tar -xzvf nanodb_coco_2017.tar.gz
|
159
|
-
fi
|
160
|
-
|
161
|
-
# RUN
|
162
|
-
cd $JETSON_REPO_PATH
|
163
|
-
./run.sh $(./autotag nanodb) \
|
164
|
-
python3 -m nanodb \
|
165
|
-
--path /data/nanodb/coco/2017 \
|
166
|
-
--server --port=7860
|
105
|
+
script_dir=$(dirname "$0")
|
106
|
+
bash $script_dir/nanodb.sh
|
107
|
+
;;
|
108
|
+
"live-llava")
|
109
|
+
script_dir=$(dirname "$0")
|
110
|
+
bash $script_dir/live-llava.sh
|
167
111
|
;;
|
168
112
|
*)
|
169
113
|
echo "Unknown example"
|
@@ -1,9 +0,0 @@
|
|
1
|
-
jetson_examples-0.0.2.data/data/scripts/run.sh,sha256=URYwn-EKgLolwNorU-d_LlaZC925sYg7nZO-guOcAsQ,5617
|
2
|
-
reComputer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
|
-
reComputer/main.py,sha256=K-ZpxttBOmEdLKyy6fIN8K4EMJ48dVIN88WvbWioB4Q,1109
|
4
|
-
jetson_examples-0.0.2.dist-info/LICENSE,sha256=ac_LOi8ChcJhymEfBulX98Y06wTI2IMcQnqCXZ5yay4,1066
|
5
|
-
jetson_examples-0.0.2.dist-info/METADATA,sha256=0KWbVkJD9CZt3yDzfPD-F5Ma7NJwA9khUiIaoDnfwa4,2751
|
6
|
-
jetson_examples-0.0.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
7
|
-
jetson_examples-0.0.2.dist-info/entry_points.txt,sha256=5-OdcBifoDjVXE9KjNoN6tQa8l_XSXhdbBEgL2hxeDM,58
|
8
|
-
jetson_examples-0.0.2.dist-info/top_level.txt,sha256=SI-liiUOkoGwOJfMP7d7k63JKgdcbiEj6DEC8QIKI90,11
|
9
|
-
jetson_examples-0.0.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|