# yolo-inference **Repository Path**: wangjq4214/yolo-inference ## Basic Information - **Project Name**: yolo-inference - **Description**: yolo-inference - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-18 - **Last Updated**: 2025-02-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Yolo Example ## 1. Inference This is a simple example of how to use Yolo Inference. ### 1.1. How to run the app We strongly recommend using [Docker](https://docs.docker.com/get-started/) to run this app locally. #### 1.1.1. Build the Docker image First, make sure you have [Docker](https://docs.docker.com/get-started/) installed on your machine. And run the following command to build the Docker image: ```bash docker build -f docker/inference . -t yolo-inference ``` #### 1.1.2. Run the Docker container To run the Docker container, run the following command: ```bash docker run -p 8000:8000 yolo-inference ``` ### 1.2. The running environment variables Must specific environment variables: - `YOLO_INFERENCE_WEIGHT_PATH`: The path to the model file. Optional environment variables: - `YOLO_INFERENCE_SAVE_RESULT`: Whether to save the result. (Default: `False`) - `YOLO_INFERENCE_SAVE_PATH`: The path to save the result. (Default: `./result`) If you enable `YOLO_INFERENCE_SAVE_RESULT`, the inference result will be saved to `YOLO_INFERENCE_SAVE_PATH`. ## 2. Training This is a simple example of how to use Yolo Training. ### 1.1. How to run the app We strongly recommend using [Docker](https://docs.docker.com/get-started/) to run this app locally. #### 1.1.1. Build the Docker image First, make sure you have [Docker](https://docs.docker.com/get-started/) installed on your machine. And run the following command to build the Docker image: ```bash docker build -f docker/train . -t yolo-train ``` #### 1.1.2. Run the Docker container To run the Docker container, run the following command: ```bash docker run -p 8000:8000 yolo-train ``` ### 1.2. The running environment variables Must specific environment variables: - `YOLO_TRAIN_WEIGHT_PATH`: The path to the model file. - `YOLO_TRAIN_DATASET_PATH`: The path to the dataset file. Optional environment variables: - `YOLO_TRAIN_EPOCHS`: The number of epochs to train. (Default: `10`) - `YOLO_TRAIN_BATCH_SIZE`: The batch size to use during training. (Default: `16`) - `YOLO_TRAIN_LEARNING_RATE`: The learning rate to use during training. (Default: `0.001`) ### 1.3. The dataset struct The dataset struct is as follows: ``` . |- data.yaml |- images |--- train |----- 0.jpg |--- val |----- 1.jpg |- labels |--- train |----- 0.txt |--- val |----- 1.txt ```