CLI use

CLI use1. Download source code2. Enable optimal performance of the motherboard2.1. Enable MAX Power Mode2.2. Enable Jetson Clocks3. Use CLI prediction3.1. CLI usage syntax3.2. Image predictionEffect preview3.3, Video PredictionEffect preview3.4, Real-time predictionReferences

1. Download source code

2. Enable optimal performance of the motherboard

2.1. Enable MAX Power Mode

Enabling MAX Power Mode on Jetson will ensure that all CPU and GPU cores are turned on:

2.2. Enable Jetson Clocks

Enabling Jetson Clocks will ensure that all CPU and GPU cores run at maximum frequency:

3. Use CLI prediction

CLI (Command-Line Interface) is a way for users to interact with computers or software programs. Users run programs or perform tasks by typing text commands instead of clicking icons or buttons through a graphical user interface (GUI).

3.1. CLI usage syntax

3.2. Image prediction

Use yolo11n.pt to predict the built-in images in the ultralytics project: If the system does not find the corresponding model file in the directory where the command is run, it will automatically download it (if it cannot be downloaded, you can copy the model into it yourself)

Enter the project folder:

Use yolo11n.pt to detect the images in the target folder and output the results:

image-20241228111341948

Effect preview

Video location of yolo recognition output: /home/jetson/ultralytics/ultralytics/runs/detect;

Each time it runs, the predict in this folder automatically increases by 1

image-20241228111925618

3.3, Video Prediction

Use yolo11n.pt to predict videos under the ultralytics project (not the videos that come with ultralytics): If the system does not find the corresponding model file in the directory where the command is run, it will automatically download it (if it cannot be downloaded, you can copy the model into it yourself)

Enter the project folder:

Use yolo11n.pt to detect the video in the target folder and output the result:

image-20241228112309663

Effect preview

Video location of yolo recognition output: /home/jetson/ultralytics/ultralytics/runs/detect

Each time it runs, the predict in this folder automatically increases by 1

You can use ffmpeg to view the video and install it using the following command:

Play video:

image-20241228113207095

3.4, Real-time prediction

Use yolo11n.pt to predict the USB camera screen: If the system does not find the corresponding model file in the directory where the command is run, it will automatically download it (if it cannot be downloaded, you can copy the model into it yourself)

Enter the project folder:

Use yolo11n.pt to detect the camera image and output the result: Currently, only USB cameras can directly use CLI to predict real-time images. CSI cameras have not found relevant information directly as input sources

Click the terminal and press the "Ctrl + C" shortcut key to terminate the program!

Parameter Description

model: Specify the YOLO model

source: Specify the recognition source: Multiple cameras can switch numbers

save=False: Disable saving results

show: Real-time display

image-20241228120053868

References

https://github.com/ultralytics/ultralytics

https://docs.ultralytics.com/usage/cli/