Welcome to Jetson Orin NX Developer Kit repository
当製品の日本語版マニュアル資料は、こちらからご取得ください。
02.CLI use
CLI use
CLI use1. An introduction to the CLI2. Enable the maximum performance of the mainboard2.1. Enable the MAX power mode2.2. Enable the Jetson clocks3. Predict with the CLI3.1. CLI usage syntax3.2. Image predictionEffect preview3.3. Video predictionPreview of the effect3.4. Real-time predictionReferences
1. An introduction to the CLI
CLI (Command-Line Interface, the command line interface) is a user interface with which you interact with a computer system or a program by typing text commands on the keyboard. It was the mainstream interaction method before the graphical user interface (GUI) became widespread, and it is still widely used today in the fields of system administration, automation scripts, development tools and so on.
2. Enable the maximum performance of the mainboard
2.1. Enable the MAX power mode
Enabling the MAX Power Mode (the maximum power mode) on the Jetson ensures that all the CPU and GPU cores are turned on:
sudo nvpmodel -m 0
2.2. Enable the Jetson clocks
Enabling the Jetson Clocks ensures that all the CPU and GPU cores run at the maximum frequency:
xxxxxxxxxxsudo jetson_clocks
3. Predict with the CLI
The following CLI commands are all run in the desktop terminal.
3.1. CLI usage syntax
xyolo TASK MODE ARGSWhere TASK (optional) is one of [detect, segment, classify, pose, obb]MODE (required) is one of [train, val, predict, export, track, benchmark]ARGS (optional) are any number of custom 'arg=value' pairs like 'imgsz=320' that override defaults.
3.2. Image prediction
Use yolo26n.pt to predict the images that come with the ultralytics project: if the system does not find the corresponding model file in the directory in which the command is run, it is downloaded automatically (if it cannot be downloaded, you can copy the model in yourself)
Enter the project folder:
xxxxxxxxxxcd /home/jetson/ultralytics/ultralytics/
Use yolo26n.pt to detect the images in the target folder and output the results:
xxxxxxxxxxyolo predict model=yolo26n source='/home/jetson/ultralytics/ultralytics/assets'

Note: every time it runs, the predict under the output folder is incremented automatically by 1; note down the path that the program prints.

Effect preview
The location of the output of the yolo recognition: /home/jetson/ultralytics/runs/detect
Note: the actual path is the one printed above. /home/jetson/ultralytics/runs/detect/predict

3.3. Video prediction
Use yolo26n.pt to predict the videos under the ultralytics project (not the videos that come with ultralytics; if the program cannot find the video, you have to put the video file manually into the /home/jetson/ultralytics/ultralytics/videos path): if the system does not find the corresponding model file in the directory in which the command is run, it is downloaded automatically (if it cannot be downloaded, you can copy the model in yourself)
Enter the project folder:
xxxxxxxxxxcd /home/jetson/ultralytics/ultralytics
Use yolo26n.pt to detect the videos in the target folder and output the results:
xxxxxxxxxxyolo predict model=yolo26n source='/home/jetson/ultralytics/ultralytics/videos'

Every time it runs, the predict under that folder is incremented automatically by 1; note down the path that the program prints.

Preview of the effect
The location of the videos that the yolo recognition outputs: /home/jetson/ultralytics/runs/detect
You can watch the video with ffmpeg; install it with the following command:
xxxxxxxxxxsudo apt install ffmpeg -y
Enter the path of the video input:
Note: because the predict is incremented automatically by 1 every time the program runs, the actual output is the reference. predict-9 has to be changed to the actual name of the folder.
xxxxxxxxxxcd /home/jetson/ultralytics/ultralytics/runs/detect/predict-9
Play the video:
xxxxxxxxxxffplay people_animals.avi

3.4. Real-time prediction
First plug the USB camera into the USB port of the mainboard.
Use yolo26n.pt to predict the image of the USB camera: if the system does not find the corresponding model file in the directory in which the command is run, it is downloaded automatically (if it cannot be downloaded, you can copy the model in yourself)
Enter the project folder:
xxxxxxxxxxcd /home/jetson/ultralytics/ultralytics
Use yolo26n.pt to detect the camera image and output the results; choose one of the following functions to run.
After the program runs, it opens the camera image, detects it in real time and displays the output result on the image.
xxxxxxxxxx# Object detectionyolo predict model=yolo26n.pt source=0 save=False show# Instance segmentation:yolo predict model=yolo26n-seg.pt source=0 save=False show# Image classification:yolo predict model=yolo26n-cls.pt source=0 save=False show# Pose estimation:yolo predict model=yolo26n-pose.pt source=0 save=False show# Oriented object detection:yolo predict model=yolo26n-obb.pt source=0 save=False show
If it is the first time you run the program, the model has to be loaded, so the loading takes a while; please be patient.
Click in the terminal and press the "Ctrl + C" shortcut to terminate the program!
Parameter description
model: specifies the YOLO model
source: specifies the recognition source: the number can be switched among multiple cameras
save=False: disables saving the results
show: displays in real time
