Welcome to ROSMASTER A1 repository
2.CLI use
CLI use
Note: Using the Docker container in the factory image does not require re-setting up the environment. The environment is already set up. Simply enter Docker and run the corresponding function commands according to the previous tutorial.
1. Download the Source Code
⚠️ If you are using the Docker container in the factory image, you do not need to download this step and can skip it.
xxxxxxxxxxgit clone https://github.com/ultralytics/ultralytics.git
2. Using the CLI for Prediction
A command-line interface (CLI) is a way for users to interact with a computer or software program by typing text commands to run a program or perform tasks, rather than clicking icons or buttons through a graphical user interface (GUI).
2.1. CLI Syntax
xxxxxxxxxxyolo 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.2.2 Image Prediction
Use yolo11n.pt to predict images included with the Ultralytics project. If the system doesn't find the corresponding model file in the directory where you run the command, it will automatically download it. (If the download fails, you can copy the model file into the directory.)
Go to the project folder:
xxxxxxxxxxcd ~/ultralytics/ultralyticsUse yolo11n.pt to detect images in the target folder and output the results:
# The image path can be customized to your own image.yolo predict model=yolo11n source='/root/ultralytics/ultralytics/assets/bus.jpg'
If the image above appears, the prediction is successful.
Preview
Yolo recognizes the output video location.
xxxxxxxxxx/root/ultralytics/ultralytics/runs/detect
With each run, the predict value in this folder automatically increments by 1.

2.3 Video Prediction
Use yolo11n.pt to predict videos in the Ultralytics project (not included with Ultralytics): If the system doesn't find the corresponding model file in the directory where you run the command, it will automatically download it. (If it can't download, you can copy the model into the directory.)
Go to the project folder:
xxxxxxxxxxcd ~/ultralytics/ultralytics
Use yolo11n.pt to detect videos in the target folder and output the results:
# The video path can be customized.yolo predict model=yolo11n source='/root/ultralytics/ultralytics/videos/people_animals.mp4'
The above image indicates a successful prediction.
Preview
Yolo recognizes the output video location.
xxxxxxxxxx/root/ultralytics/ultralytics/runs/detect
The prediction value in this folder automatically increments by 1 with each run.

You can use ffmpeg to view the video. Install it using the following command:
xxxxxxxxxxsudo apt updatesudo apt install ffmpeg -y
Play the video:
xxxxxxxxxxffplay -x 640 -y 480 <video_name>.avi

2.4. Real-time Prediction
⚠️This feature only supports USB cameras; depth cameras are not supported by the CLI.
Use yolo11n.pt to predict the USB camera image. If the system does not find the corresponding model file in the directory where the command is run, it will automatically download it.
Go to the project folder:
xxxxxxxxxxcd ~/ultralytics/ultralytics
Use yolo11n.pt to detect the camera image and output the results.
yolo predict model=yolo11n.pt source=0 save=False show # Object Detection# Instance Segmentation: yolo predict model=yolo11n-seg.pt source=0 save=False show# Image Classification: yolo predict model=yolo11n-cls.pt source=0 save=False show# Pose Estimation: yolo predict model=yolo11n-pose.pt source=0 save=False show# Oriented Object Detection: yolo predict model=yolo11n-obb.pt source=0 save=False showClick the terminal and press the "Ctrl + C" shortcut to terminate the program!
Parameter Description
model: Specifies the YOLO model
source: Specifies the recognition source (multiple cameras can switch between digital ones)
save=False: Disables saving results
show: Displays results in real time
