### Install Tensorboard Package Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_instance_segmentation.md Installs the Tensorboard Python package using pip, a prerequisite for visualizing training metrics. ```shell pip install tensorboard ``` -------------------------------- ### Install Tensorboard Package Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_instance_segmentation.md Installs the Tensorboard package using pip, a prerequisite for visualizing training metrics and model inference results. ```shell pip install tensorboard ``` -------------------------------- ### Launch LLaVA-NeXT Video Model on First Node with SGLang Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/LLaVA_NeXT/README.md Instructions to launch the LLaVA-NeXT video model on the first node of a multi-node setup using SGLang's SRT example script. This command first navigates to the SGLang project directory and then initializes the model with a specified video path, model path, and frames per video. For example: bash examples/usage/llava_video/srt_example_llava_v.sh K 0 examples/usage/llava_video/videos/Q98Z4OTh8RwmDonc.mp4 lmms-lab/LLaVA-NeXT-Video-7B-DPO 16 ```sh cd PATH_TO/sglang bash examples/usage/llava_video/srt_example_llava_v.sh K 0 YOUR_VIDEO_PATH YOUR_MODEL_PATH FRAMES_PER_VIDEO ``` -------------------------------- ### Install TensorBoard for Visualization Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_object_detection.md Installs the TensorBoard Python package, which is required to use TensorBoard as a visualization backend for MMYOLO training metrics. ```shell pip install tensorboard ``` -------------------------------- ### Install MMYOLO and its dependencies Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_object_detection.md Clone the MMYOLO repository, navigate into it, and install required dependencies including 'openmim', 'albumentations', and MMYOLO itself in editable mode for local modifications. ```shell git clone https://github.com/open-mmlab/mmyolo.git cd mmyolo pip install -U openmim mim install -r requirements/mminstall.txt # Install albumentations mim install -r requirements/albu.txt # Install MMYOLO mim install -v -e . # "-v" means verbose, or more output # "-e" means installing a project in editable mode, # thus any local modifications made to the code will take effect without reinstallation. ``` -------------------------------- ### Install EasyDeploy Dependencies Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_object_detection.md Installs necessary Python packages for EasyDeploy, including `onnx`, `onnx-simplifier` (optional for simplification), and `tensorrt` (for GPU environments). ```shell pip install onnx pip install onnx-simplifier # Install if you want to use simplify pip install tensorrt # If you have GPU environment and need to output TensorRT model you need to continue execution ``` -------------------------------- ### Install MMYOLO and its dependency libraries Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_instance_segmentation.md Clones the MMYOLO repository, navigates into it, and installs required dependencies using `mim` and `pip`. The editable installation mode (`-e`) ensures that local modifications to the code take effect without reinstallation. ```shell git clone https://github.com/open-mmlab/mmyolo.git cd mmyolo pip install -U openmim mim install -r requirements/mminstall.txt # Install albumentations mim install -r requirements/albu.txt # Install MMYOLO mim install -v -e . # "-v" means verbose, or more output # "-e" means installing a project in editable mode, # thus any local modifications made to the code will take effect without reinstallation. ``` -------------------------------- ### Install TensorBoard for Training Visualization Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_object_detection.md This command installs the 'tensorboard' Python package, which is required to use TensorBoard for visualizing training metrics and results. ```shell pip install tensorboard ``` -------------------------------- ### Install MMYOLO and its dependencies Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_object_detection.md Commands to clone the MMYOLO repository, navigate into the directory, and install all necessary dependencies including openmim, mminstall, albumentations, and MMYOLO itself in editable mode for development. ```shell git clone https://github.com/open-mmlab/mmyolo.git cd mmyolo pip install -U openmim mim install -r requirements/mminstall.txt # Install albumentations mim install -r requirements/albu.txt # Install MMYOLO mim install -v -e . # "-v" means verbose, or more output # "-e" means installing a project in editable mode, # thus any local modifications made to the code will take effect without reinstallation. ``` -------------------------------- ### Install Tensorboard Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/demo/15_minutes_instance_segmentation.ipynb This command installs the Tensorboard library, a visualization tool for machine learning experiments, into the current Python environment, typically used in Jupyter notebooks. ```Python %pip install tensorboard ``` -------------------------------- ### Install Tensorboard Python Package Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/demo/15_minutes_instance_segmentation.ipynb Installs the Tensorboard library using pip, making it available for visualizing machine learning experiments. This is a prerequisite for using Tensorboard as a visualization backend. ```shell %pip install tensorboard ``` -------------------------------- ### Launch LLaVA-NeXT Video Model on K-th Node with SGLang Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/LLaVA_NeXT/README.md Command to launch the LLaVA-NeXT video model on the K-th (last) node of a multi-node setup using SGLang's SRT example script. This completes the distributed deployment across K nodes. ```sh bash examples/usage/llava_video/srt_example_llava_v.sh K K-1 YOUR_VIDEO_PATH YOUR_MODEL_PATH FRAMES_PER_VIDEO ``` -------------------------------- ### Install and Log In to Weights & Biases (WandB) Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_instance_segmentation.md This shell snippet provides commands to install the Weights & Biases (WandB) library and log in to the service. Users need to run `pip install wandb` to get the package, then `wandb login` and enter their API Key to authenticate, enabling real-time visualization of training metrics. ```Shell pip install wandb # After running wandb login, enter the API Keys obtained above, and the login is successful. wandb login ``` -------------------------------- ### Install MMYOLO and its dependency libraries Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_instance_segmentation.md Clone the MMYOLO repository and install required dependencies using `mim` and `pip`. The editable installation mode allows any local modifications made to the code to take effect without reinstallation. ```shell git clone https://github.com/open-mmlab/mmyolo.git cd mmyolo pip install -U openmim mim install -r requirements/mminstall.txt # Install albumentations mim install -r requirements/albu.txt # Install MMYOLO mim install -v -e . ``` -------------------------------- ### Launch TensorBoard to View MMYOLO Training Logs Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/demo/15_minutes_object_detection.ipynb This command starts the TensorBoard web interface, allowing users to visualize training metrics and results. It points to the directory where MMYOLO stores its visualization data, enabling interactive exploration of loss, learning rate, and mAP curves. ```python !tensorboard --logdir=work_dirs/yolov5_s-v61_fast_1xb12-40e_cat ``` -------------------------------- ### Launch Tensorboard for YOLOv5 Training Logs Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_instance_segmentation.md Starts the Tensorboard web interface, pointing it to the directory containing YOLOv5 training logs to visualize loss, learning rate, and mAP metrics. ```shell tensorboard --logdir=work_dirs/yolov5_ins_s-v61_syncbn_fast_8xb16-300e_balloon_instance ``` -------------------------------- ### Install WandB and Authenticate for Visualization Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_object_detection.md This snippet provides commands to install the 'wandb' Python package and then log in using an API key obtained from the WandB website, which is necessary to enable real-time training visualization. ```shell pip install wandb wandb login ``` -------------------------------- ### Launch Tensorboard for Training Visualization Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_instance_segmentation.md Starts the Tensorboard web interface, allowing users to view training metrics like loss, learning rate, and mAP visualizations from the specified work directory. ```shell tensorboard --logdir=work_dirs/yolov5_ins_s-v61_syncbn_fast_8xb16-300e_balloon_instance ``` -------------------------------- ### Install WandB for Training Visualization Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/demo/15_minutes_instance_segmentation.ipynb This Python command installs the `wandb` library, which is required to integrate Weights & Biases for real-time visualization and tracking of training metrics, losses, and other relevant data. ```Python %pip install wandb ``` -------------------------------- ### Launch LLaVA-NeXT Video Model on Second Node with SGLang Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/LLaVA_NeXT/README.md Command to launch the LLaVA-NeXT video model on the second node of a multi-node setup using SGLang's SRT example script. This command is part of a distributed deployment. ```sh bash examples/usage/llava_video/srt_example_llava_v.sh K 1 YOUR_VIDEO_PATH YOUR_MODEL_PATH FRAMES_PER_VIDEO ``` -------------------------------- ### Install MMYOLO and Required Libraries Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/demo/15_minutes_object_detection.ipynb This snippet outlines the steps to clone the MMYOLO repository, navigate into its directory, and install all necessary dependencies using `openmim`. It includes commands for installing core requirements, `albumentations`, and MMYOLO itself in editable mode. ```python !git clone https://github.com/open-mmlab/mmyolo.git %cd mmyolo %pip install -U openmim !mim install -r requirements/mminstall.txt # Install albumentations !mim install -r requirements/albu.txt # Install MMYOLO !mim install -v -e . # "-v" means verbose, or more output # "-e" means installing a project in editable mode, # thus any local modifications made to the code will take effect without reinstallation. ``` -------------------------------- ### Install Weights & Biases (WandB) for Visualization Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_object_detection.md Installs the Weights & Biases Python package, a prerequisite for using WandB as a real-time training visualization backend in MMYOLO. ```shell pip install wandb ``` -------------------------------- ### Install Grad-CAM Python Package Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_object_detection.md Installs the `grad-cam` Python package, which is a prerequisite for performing Grad-Based CAM visualization at the bounding box level. ```Shell pip install "grad-cam" ``` -------------------------------- ### Launch TensorBoard to View Training Logs Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_object_detection.md Starts the TensorBoard web interface, pointing it to the directory containing the generated training logs. This allows users to visualize metrics like loss, learning rate, and mAP from the training process in a browser. ```shell tensorboard --logdir=work_dirs/yolov5_s-v61_fast_1xb12-40e_cat ``` -------------------------------- ### Install and Log In to WandB for Visualization Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_instance_segmentation.md These shell commands are used to set up Weights & Biases (WandB) for training visualization. The first command installs the 'wandb' library, and the second command initiates the login process, requiring the user to enter their API Key. ```Shell pip install wandb wandb login ``` -------------------------------- ### Launch Tensorboard to View Training Logs Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/demo/15_minutes_instance_segmentation.ipynb Starts the Tensorboard web interface, pointing it to the directory containing the training logs. Users can then access a local web link to visualize metrics like loss, learning rate, and mAP. ```shell !tensorboard --logdir=work_dirs/yolov5_ins_s-v61_syncbn_fast_8xb16-300e_balloon_instance ``` -------------------------------- ### Set up Conda environment and install PyTorch for MMYOLO Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_object_detection.md Commands to create a new Conda virtual environment named 'mmyolo' with Python 3.8 and install PyTorch, with options provided for both GPU and CPU installations. ```shell conda create -n mmyolo python=3.8 -y conda activate mmyolo # If you have GPU conda install pytorch torchvision -c pytorch # If you only have CPU # conda install pytorch torchvision cpuonly -c pytorch ``` -------------------------------- ### Install MMYOLO and its Dependencies Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/demo/15_minutes_instance_segmentation.ipynb This snippet outlines the steps to clone the MMYOLO repository, navigate into its directory, and install all necessary dependencies using `mim` (OpenMMLab's package manager). It includes installing core requirements, `albumentations`, and MMYOLO itself in editable mode for development flexibility. ```Python !git clone https://github.com/open-mmlab/mmyolo.git %cd mmyolo %pip install -U openmim !mim install -r requirements/mminstall.txt # Install albumentations !mim install -r requirements/albu.txt # Install MMYOLO !mim install -v -e . # "-v" means verbose, or more output # "-e" means installing a project in editable mode, # thus any local modifications made to the code will take effect without reinstallation. ``` -------------------------------- ### Clone LLaVA-NeXT Repository Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/LLaVA_NeXT/README.md This command initiates the cloning of the LLaVA-NeXT GitHub repository to your local machine. After successful cloning, it navigates into the newly created project directory, which is the foundational step for local setup. ```bash git clone https://github.com/LLaVA-VL/LLaVA-NeXT cd LLaVA-NeXT ``` -------------------------------- ### Start MMYOLO Training with Configured Visualizers Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_object_detection.md Initiates the MMYOLO training process using the specified configuration file. This command will utilize the visualization backends (e.g., Local, WandB, or TensorBoard) configured within the 'visualizer' dictionary in the config file. ```shell python tools/train.py configs/yolov5/yolov5_s-v61_fast_1xb12-40e_cat.py ``` -------------------------------- ### Launch Tensorboard for MMYOLO Logs Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/demo/15_minutes_instance_segmentation.ipynb This command starts the Tensorboard web interface, pointing it to the specified directory containing training logs. Users can then access a web link to view visualizations of loss, learning rate, and mAP metrics. ```Shell !tensorboard --logdir=work_dirs/yolov5_ins_s-v61_syncbn_fast_8xb16-300e_balloon_instance ``` -------------------------------- ### Install EasyDeploy Python Dependencies Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_object_detection.md Install the necessary Python packages for model transformation and deployment, including ONNX for model representation, ONNX-Simplifier for optimization, and TensorRT for GPU acceleration. ```shell pip install onnx pip install onnx-simplifier # Install if you want to use simplify pip install tensorrt # If you have GPU environment and need to output TensorRT model you need to continue execution ``` -------------------------------- ### Example Output Directory Structure After Deployment Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_object_detection.md Illustrates the typical directory structure within the `work_dirs` after successful model transformation and TensorRT engine building, showing the location of the generated ONNX and TensorRT engine files alongside other project artifacts. ```shell work_dirs/yolov5_s-v61_fast_1xb12-40e_cat ├── 202302XX_XXXXXX │ ├── 202302XX_XXXXXX.log │ └── vis_data │ ├── 202302XX_XXXXXX.json │ ├── config.py │ └── scalars.json ├── best_coco │ └── bbox_mAP_epoch_40.pth ├── end2end.engine ├── end2end.onnx ├── epoch_30.pth ├── epoch_40.pth ├── last_checkpoint └── yolov5_s-v61_fast_1xb12-40e_cat.py ``` -------------------------------- ### Install WandB for Training Visualization Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/demo/15_minutes_instance_segmentation.ipynb This command installs the Weights & Biases (WandB) library, which is used for real-time visualization and tracking of training metrics. Users need to register on the WandB website and obtain an API key for full functionality. ```python %pip install wandb ``` -------------------------------- ### Execute MMYOLO YOLOv5 Training with Configured Visualizers Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/demo/15_minutes_object_detection.ipynb This command starts the training process for the YOLOv5 model using the updated configuration file, which now includes the specified visualization backends. After execution, training metrics like loss, learning rate, and mAP will be visualized via the configured backend (e.g., WandB). ```python !python tools/train.py configs/yolov5/yolov5_s-v61_fast_1xb12-40e_cat.py ``` -------------------------------- ### Launch TensorBoard to View MMYOLO Training Logs Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_object_detection.md After training, this command starts a TensorBoard server, pointing it to the directory where MMYOLO saves its visualization data, allowing users to view training progress (loss, learning rate, mAP) in a web browser. ```shell tensorboard --logdir=work_dirs/yolov5_s-v61_fast_1xb12-40e_cat ``` -------------------------------- ### Install WandB and Log In for MMYOLO Visualization Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/demo/15_minutes_object_detection.ipynb These commands install the Weights & Biases library, a prerequisite for using WandB as a visualization backend. After installation, `wandb login` prompts the user to authenticate using their API key, enabling real-time metric tracking during training. ```python %pip install wandb # After running wandb login, enter the API Keys obtained above, and the login is successful. !wandb login ``` -------------------------------- ### Start Training with WandB Visualization Enabled Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_instance_segmentation.md This shell command initiates the YOLOv5 training process. When combined with the updated configuration that includes 'WandbVisBackend', this command will send training metrics and visualizations to the configured WandB project. ```Shell python tools/train.py configs/yolov5/ins_seg/yolov5_ins_s-v61_syncbn_fast_8xb16-300e_balloon_instance.py ``` -------------------------------- ### Example: Start Labelme for Cat Dataset Manual Annotation Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/recommended_topics/labeling_to_deployment_tutorials.md This example demonstrates how to start the Labelme tool for manually annotating the 'cat' dataset. It navigates to the MMYOLO project directory and then launches Labelme, specifying the image input directory and the output directory for the generated label files, with autosave and nodata flags enabled. ```shell cd /path/to/mmyolo labelme ./data/cat/images --output ./data/cat/labels --autosave --nodata ``` -------------------------------- ### Install TensorBoard for MMYOLO Training Visualization Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/demo/15_minutes_object_detection.ipynb This command installs the TensorBoard library, a powerful tool for visualizing machine learning experiments. It is a necessary prerequisite for integrating TensorBoard as a visualization backend within MMYOLO. ```python %pip install tensorboard ``` -------------------------------- ### Install MMYOLO from Source for Development Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/get_started/installation.md Clones the MMYOLO repository and installs it in editable mode, along with `albumentations` dependencies. This method is recommended for developers who need to make local modifications to the code. ```shell git clone https://github.com/open-mmlab/mmyolo.git cd mmyolo pip install -r requirements/albu.txt mim install -v -e . ``` -------------------------------- ### Install PyTorch and Check System Versions for MMYOLO Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/demo/15_minutes_instance_segmentation.ipynb This snippet guides users through installing PyTorch and its dependencies within a new Conda environment for MMYOLO. It also includes commands to verify Python, NVCC (CUDA), and GCC compiler versions, which are crucial for deep learning setups. Users can choose between GPU and CPU installations. ```Python # ----------------------------------------------------------------------------------------- # If you are using colab, you can skip this cell for PyTorch is pre-installed on the colab. # ----------------------------------------------------------------------------------------- !python -V # Check nvcc version !nvcc -V # Check GCC version !gcc --version # Create a new Conda environment %conda create -n mmyolo python=3.8 -y %conda activate mmyolo # If you have GPU %conda install pytorch torchvision -c pytorch # If you only have CPU # %conda install pytorch torchvision cpuonly -c pytorch ``` -------------------------------- ### Install Gradio and Run Local Demo Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/demo/README.md Commands to install the specific version of Gradio required for the local web-based demo. After installation, the demo can be launched by providing paths to the configuration and weight files. ```bash pip install gradio==4.16.0 python demo/demo.py path/to/config path/to/weights ``` -------------------------------- ### Install Conda environment and PyTorch for MMYOLO Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_instance_segmentation.md Create a new Conda virtual environment for MMYOLO to prevent conflicts with other OpenMMLab installations. Install PyTorch and torchvision, with separate commands provided for GPU and CPU-only setups. ```shell conda create -n mmyolo python=3.8 -y conda activate mmyolo # If you have GPU conda install pytorch torchvision -c pytorch # If you only have CPU # conda install pytorch torchvision cpuonly -c pytorch ``` -------------------------------- ### Install PyTorch and Create Conda Environment for MMYOLO Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/demo/15_minutes_instance_segmentation.ipynb Commands to check Python, NVCC, and GCC versions, then create and activate a new Conda environment named 'mmyolo' with Python 3.8. It includes instructions for installing PyTorch and torchvision for both GPU and CPU setups. Users on Colab can skip the PyTorch installation step. ```Python # ----------------------------------------------------------------------------------------- # If you are using colab, you can skip this cell for PyTorch is pre-installed on the colab. # ----------------------------------------------------------------------------------------- !python -V # Check nvcc version !nvcc -V # Check GCC version !gcc --version # Create a new Conda environment %conda create -n mmyolo python=3.8 -y %conda activate mmyolo # If you have GPU %conda install pytorch torchvision -c pytorch # If you only have CPU # %conda install pytorch torchvision cpuonly -c pytorch ``` -------------------------------- ### Simplified MIM Installation for MMYOLO Project Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/get_started/installation.md Provides a simplified method to install dependencies when already inside the mmyolo project directory, using the project's `requirements/mminstall.txt`. ```shell cd mmyolo pip install -U openmim mim install -r requirements/mminstall.txt ``` -------------------------------- ### Structure for Existing User Datasets Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/zh_cn/recommended_topics/labeling_to_deployment_tutorials.md Shows the required directory structure for users who already have their own image datasets, where images should be placed under a '$DATA_ROOT/images' directory. ```shell . └── $DATA_ROOT └── images ├── image1.jpg ├── image2.png └── ... ``` -------------------------------- ### Install MMRazor from Source Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/configs/rtmdet/distillation/README.md Instructions to clone and install the MMRazor library from its dev-1.x branch, which is a prerequisite for running the RTMDet distillation examples. This ensures the correct version of the framework is available. ```bash git clone -b dev-1.x https://github.com/open-mmlab/mmrazor.git cd mmrazor mim install -v -e . ``` -------------------------------- ### Install LLaVA-NeXT Repository Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/LLaVA_NeXT/docs/LLaVA_OneVision_Tutorials.ipynb Instructions to install the LLaVA-NeXT repository and its required environments. This command clones the repository and installs its dependencies, enabling the use of the LLaVA OneVision models. ```Shell pip install git+https://github.com/LLaVA-VL/LLaVA-NeXT.git ``` -------------------------------- ### Install Grad-CAM Python Package for Visualization Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_object_detection.md This shell command installs the `grad-cam` Python package, a prerequisite for performing Grad-Based CAM visualization on feature layers at the bbox level. ```shell pip install "grad-cam" ``` -------------------------------- ### Install PyTorch with Conda for GPU or CPU Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_instance_segmentation.md Installs PyTorch and torchvision into the active Conda environment. Users should choose the appropriate command based on whether they have a GPU (default) or only a CPU. ```shell conda install pytorch torchvision -c pytorch # If you only have CPU # conda install pytorch torchvision cpuonly -c pytorch ``` -------------------------------- ### Set up Conda environment for MMYOLO Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_object_detection.md Create a new Conda virtual environment named 'mmyolo' with Python 3.8 and install PyTorch, either for GPU or CPU, to prevent conflicts with other OpenMMLab installations. ```shell conda create -n mmyolo python=3.8 -y conda activate mmyolo # If you have GPU conda install pytorch torchvision -c pytorch # If you only have CPU # conda install pytorch torchvision cpuonly -c pytorch ``` -------------------------------- ### Install Labelme for Annotation Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/zh_cn/recommended_topics/labeling_to_deployment_tutorials.md Instructions to set up the labelme annotation tool in a conda environment, including creating a new environment, activating it, and installing the specific version 5.1.1. ```shell conda create -n labelme python=3.8 conda activate labelme pip install labelme==5.1.1 ``` -------------------------------- ### Install TensorBoard Environment Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/recommended_topics/labeling_to_deployment_tutorials.md This command installs the TensorBoard library using pip, the standard Python package installer. It sets up the necessary environment for visualizing machine learning experiment logs. ```shell pip install tensorboard ``` -------------------------------- ### Launch TensorBoard to View MMYOLO Training Logs Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/demo/15_minutes_object_detection.ipynb This command starts the TensorBoard web server, pointing it to the directory containing MMYOLO's visualization data. Users can then access a web link to view training metrics like loss and mAP. ```python !tensorboard --logdir=work_dirs/yolov5_s-v61_fast_1xb12-40e_cat ``` -------------------------------- ### Verify PyTorch Installation and CUDA Availability Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/demo/15_minutes_instance_segmentation.ipynb Python code to import the PyTorch library and print its version, along with a check for CUDA availability. This helps confirm that PyTorch has been successfully installed and can utilize a GPU if present. ```Python import torch print(torch.__version__) print(torch.cuda.is_available()) ``` -------------------------------- ### Download YOLOv5-s Pre-trained Weights Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/recommended_topics/labeling_to_deployment_tutorials.md Instructions to create a `work_dirs` directory and download the YOLOv5-s pre-trained weights from OpenMMLab's repository, essential for assisted annotation. ```shell mkdir work_dirs wget https://download.openmmlab.com/mmyolo/v0/yolov5/yolov5_s-v61_syncbn_fast_8xb16-300e_coco/yolov5_s-v61_syncbn_fast_8xb16-300e_coco_20220918_084700-86e02187.pth -P ./work_dirs ``` -------------------------------- ### Run YOLOv5 Training with Configured Backend Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/demo/15_minutes_instance_segmentation.ipynb Executes the YOLOv5 training script using the specified configuration file. This command initiates the model training process, which will log metrics to the configured visualization backends (e.g., Wandb or Tensorboard). ```shell !python tools/train.py configs/yolov5/ins_seg/yolov5_ins_s-v61_syncbn_fast_8xb16-300e_balloon_instance.py ``` -------------------------------- ### Verify PyTorch Installation and CUDA Availability Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/demo/15_minutes_instance_segmentation.ipynb This Python snippet imports the PyTorch library and prints its installed version. It also checks and reports whether a CUDA-enabled GPU is available for use, which is essential for accelerating deep learning computations. ```Python import torch print(torch.__version__) print(torch.cuda.is_available()) ``` -------------------------------- ### BibTeX Citation for LLaVA-NeXT Video Understanding Blog Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/LLaVA_NeXT/README.md BibTeX entry for citing the blog post 'LLaVA-NeXT: A Strong Zero-shot Video Understanding Model'. ```bibtex @misc{zhang2024llavanext-video, title={LLaVA-NeXT: A Strong Zero-shot Video Understanding Model}, url={https://llava-vl.github.io/blog/2024-04-30-llava-next-video/}, author={Zhang, Yuanhan and Li, Bo and Liu, haotian and Lee, Yong jae and Gui, Liangke and Fu, Di and Feng, Jiashi and Liu, Ziwei and Li, Chunyuan}, month={April}, year={2024} } ``` -------------------------------- ### Install MMYOLO and OpenMMLab Dependencies Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/demo/15_minutes_instance_segmentation.ipynb Commands to clone the MMYOLO repository, navigate into it, and install necessary dependencies using `openmim`. This includes core requirements, `albumentations`, and MMYOLO itself in editable mode, allowing local modifications to take effect without reinstallation. It's recommended to use a new Conda environment to avoid conflicts with OpenMMLab 1.0 installations. ```Python !git clone https://github.com/open-mmlab/mmyolo.git %cd mmyolo %pip install -U openmim !mim install -r requirements/mminstall.txt # Install albumentations !mim install -r requirements/albu.txt # Install MMYOLO !mim install -v -e . # "-v" means verbose, or more output # "-e" means installing a project in editable mode, # thus any local modifications made to the code will take effect without reinstallation. ``` -------------------------------- ### Install PyTorch with Conda for MMYOLO Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/zh_cn/get_started/15_minutes_instance_segmentation.md This snippet provides shell commands to set up a new Conda environment named 'mmyolo' with Python 3.8. It then guides the user to activate the environment and install PyTorch and torchvision, offering separate commands for GPU and CPU installations. ```shell conda create -n mmyolo python=3.8 -y conda activate mmyolo # If you have a GPU conda install pytorch torchvision -c pytorch # If you are CPU only # conda install pytorch torchvision cpuonly -c pytorch ``` -------------------------------- ### Install LLaVA-NeXT Inference and Training Package Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/LLaVA_NeXT/README.md These commands guide the user through setting up a dedicated Conda environment for LLaVA-NeXT, activating it, and then installing the required Python packages for both inference and training. This ensures all project dependencies are met, including support for PEP 660. ```bash conda create -n llava python=3.10 -y conda activate llava pip install --upgrade pip # Enable PEP 660 support. pip install -e ".[train]" ``` -------------------------------- ### Perform SDK Model Inference with MMDeploy Runtime Detector Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/recommended_topics/deploy/mmdeploy_guide.md This example demonstrates a simplified approach to model inference using the `mmdeploy_runtime.Detector` class from the MMDeploy SDK. It shows how to initialize a detector with a model path and device, perform inference on an image, and then visualize the bounding box detections. ```python from mmdeploy_runtime import Detector import cv2 img = cv2.imread('demo/demo.jpg') # create a detector detector = Detector(model_path='mmdeploy_models/mmyolo/onnx', device_name='cpu', device_id=0) # perform inference bboxes, labels, masks = detector(img) # visualize inference result indices = [i for i in range(len(bboxes))] for index, bbox, label_id in zip(indices, bboxes, labels): [left, top, right, bottom], score = bbox[0:4].astype(int), bbox[4] if score < 0.3: continue cv2.rectangle(img, (left, top), (right, bottom), (0, 255, 0)) cv2.imwrite('work_dir/output_detection.png', img) ``` -------------------------------- ### Create and activate Conda environment for MMYOLO Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/get_started/15_minutes_instance_segmentation.md This command creates a new Conda virtual environment named 'mmyolo' with Python 3.8 and activates it. It is recommended to create a new environment to prevent conflicts with existing OpenMMLab 1.0 installations. ```shell conda create -n mmyolo python=3.8 -y conda activate mmyolo ``` -------------------------------- ### Launch Labelme for Image Annotation Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/zh_cn/recommended_topics/labeling_to_deployment_tutorials.md Command to start the labelme annotation tool, specifying input image directory, output label file directory, enabling autosave, and disabling base64 image data saving to reduce file size. Includes an example command. ```shell labelme ${图片文件夹路径(即上一步的图片文件夹)} \ --output ${label文件所处的文件夹路径(即上一步的 --out-dir)} \ --autosave \ --nodata ``` ```shell cd /path/to/mmyolo labelme ./data/cat/images --output ./data/cat/labels --autosave --nodata ``` -------------------------------- ### MMDeploy Deploy Script Parameter Reference Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/recommended_topics/deploy/mmdeploy_guide.md This section details the command-line parameters for the `MMDeploy` `deploy.py` script, providing descriptions, example values, and default behaviors for each argument. It covers configuration paths, model checkpoints, input/output settings, and logging options. ```APIDOC deploy_cfg: set the deployment config path of MMDeploy for the model, including the type of inference framework, whether quantize, whether the input shape is dynamic, etc. There may be a reference relationship between configuration files, e.g. configs/deploy/detection_onnxruntime_static.py model_cfg: set the MMYOLO model config path, e.g. configs/deploy/model/yolov5_s-deploy.py, regardless of the path to MMDeploy checkpoint: set the torch model path. It can start with http/https, more details are available in mmengine.fileio apis img: set the path to the image or point cloud file used for testing during model conversion --test-img: set the image file that used to test model. If not specified, it will be set to None --work-dir: set the work directory that used to save logs and models --calib-dataset-cfg: use for calibration only for INT8 mode. If not specified, it will be set to None and use “val” dataset in model config for calibration --device: set the device used for model conversion. The default is cpu, for TensorRT used cuda:0 --log-level: set log level which in 'CRITICAL', 'FATAL', 'ERROR', 'WARN', 'WARNING', 'INFO', 'DEBUG', 'NOTSET'. If not specified, it will be set to INFO --show: show the result on screen or not --dump-info: output SDK information or not ``` -------------------------------- ### Simplified Dependency Installation in MMYOLO Directory Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/get_started/installation.md Installs required dependencies for MMYOLO from the `requirements/mminstall.txt` file. This command is a simplified approach when executed from within the `mmyolo` project directory. ```shell cd mmyolo pip install -U openmim mim install -r requirements/mminstall.txt ``` -------------------------------- ### Install TensorBoard Python Package Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/recommended_topics/labeling_to_deployment_tutorials.md Installs the TensorBoard library using pip, which is a prerequisite for logging and visualizing training metrics. This command should be run in your project's environment. ```shell pip install tensorboard ``` -------------------------------- ### Python Module Docstring Example Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/zh_cn/notes/code_style.md Illustrates the recommended structure for a module-level docstring, including a concise one-line summary, a detailed description, and optional usage examples. While recommended by style guides, it notes that many OpenMMLab projects currently do not strictly enforce this. ```python """A one line summary of the module or program, terminated by a period. Leave one blank line. The rest of this docstring should contain an overall description of the module or program. Optionally, it may also contain a brief description of exported classes and functions and/or usage examples. Typical usage example: foo = ClassFoo() bar = foo.FunctionBar() """ ``` -------------------------------- ### Install and Log In to Weights & Biases (wandb) Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/recommended_topics/labeling_to_deployment_tutorials.md This command sequence installs the `wandb` Python package and then initiates the login process. Users need to provide their API Key, obtained from the wandb website, to successfully authenticate and enable training visualization with Weights & Biases. ```shell pip install wandb # After running wandb login, enter the API Keys obtained above, and the login is successful. wandb login ``` -------------------------------- ### Launch TensorBoard to View Training Logs Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/recommended_topics/labeling_to_deployment_tutorials.md Starts the TensorBoard web interface, pointing it to the directory where training logs are stored. This command allows users to access a web-based dashboard to visualize various training metrics such as loss, learning rate, and mAP over time. ```shell tensorboard --logdir=work_dirs/yolov5_s-v61_syncbn_fast_1xb32-100e_cat ``` -------------------------------- ### Install MMEngine, MMCV, and MMDetection using MIM Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/get_started/installation.md Installs core OpenMMLab dependencies (MMEngine, MMCV, MMDetection) using the MIM package manager. These are prerequisites for MMYOLO and ensure compatibility. ```shell pip install -U openmim mim install "mmengine>=0.6.0" mim install "mmcv>=2.0.0rc4,<2.1.0" mim install "mmdet>=3.0.0,<4.0.0" ``` -------------------------------- ### Install EasyDeploy Dependencies Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/demo/15_minutes_object_detection.ipynb Installs necessary Python packages like onnx, onnx-simplifier, and tensorrt for model transformation and deployment with EasyDeploy. TensorRT is optional and required only for GPU environments. ```python %pip install onnx %pip install onnx-simplifier # Install if you want to use simplify %pip install tensorrt # If you have GPU environment and need to output TensorRT model you need to continue execution ``` -------------------------------- ### Install MMYOLO as a Dependency using MIM Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/get_started/installation.md Installs MMYOLO as a standard package using the MIM package manager. This method is suitable when MMYOLO is used as a third-party library or dependency in another project. ```shell mim install "mmyolo" ``` -------------------------------- ### Start Labelme Command-line Options Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/docs/en/recommended_topics/labeling_to_deployment_tutorials.md Explains the command-line arguments for launching the Labelme annotation tool. It covers specifying image and output directories, enabling autosave, and preventing the storage of base64 image data to reduce file size. ```shell labelme ${image dir path (same as the previous step)} \ --output ${the dir path of label file(same as --out-dir)} \ --autosave \ --nodata ``` -------------------------------- ### Install MMYOLO and OpenMMLab Dependencies Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/demo/15_minutes_object_detection.ipynb This snippet outlines the steps to clone the MMYOLO repository, navigate into its directory, and install all necessary dependencies using `mim`. It includes installation of `openmim`, core requirements, `albumentations`, and MMYOLO itself in editable mode. ```python !git clone https://github.com/open-mmlab/mmyolo.git %cd mmyolo %pip install -U openmim !mim install -r requirements/mminstall.txt # Install albumentations !mim install -r requirements/albu.txt # Install MMYOLO !mim install -v -e . # "-v" means verbose, or more output # "-e" means installing a project in editable mode, # thus any local modifications made to the code will take effect without reinstallation. ``` -------------------------------- ### Verify PyTorch Installation Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/demo/15_minutes_object_detection.ipynb This Python code imports the PyTorch library and prints its version. It also checks and prints whether a CUDA-enabled GPU is available, confirming a successful PyTorch installation. ```python import torch print(torch.__version__) print(torch.cuda.is_available()) ``` -------------------------------- ### Verify PyTorch Installation Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/YOLO-World/mmyolo/demo/15_minutes_object_detection.ipynb This Python code checks the installed PyTorch version and verifies if CUDA (GPU support) is available. It's a quick way to confirm a successful PyTorch setup. ```python import torch print(torch.__version__) print(torch.cuda.is_available()) ``` -------------------------------- ### Verify MMYOLO Installation with Image Demo (Source Install) Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/get_started/installation.md Runs an image inference demo using the installed MMYOLO from source, processing a sample image and outputting detection results. Includes optional parameters for customization. ```shell python demo/image_demo.py demo/demo.jpg \ yolov5_s-v61_syncbn_fast_8xb16-300e_coco.py \ yolov5_s-v61_syncbn_fast_8xb16-300e_coco_20220918_084700-86e02187.pth # Optional parameters # --out-dir ./output *The detection results are output to the specified directory. When args have action --show, the script do not save results. Default: ./output # --device cuda:0 *The computing resources used, including cuda and cpu. Default: cuda:0 # --show *Display the results on the screen. Default: False # --score-thr 0.3 *Confidence threshold. Default: 0.3 ``` -------------------------------- ### Download Sample Cat Dataset Source: https://github.com/vchitect/vbench/blob/master/VBench-2.0/vbench2/third_party/ViTDetector/third_party/YOLO-World/mmyolo/docs/en/recommended_topics/labeling_to_deployment_tutorials.md This command downloads a sample 'cat' dataset (217 MB) provided for the tutorial. It saves the dataset to './data/cat', unzips it, and then deletes the compressed archive, providing a ready-to-use dataset for the subsequent steps. ```shell python tools/misc/download_dataset.py --dataset-name cat --save-dir ./data/cat --unzip --delete ```