# yolov8-fastapi
This is an API for detecting LPG inspection images using YOLOv8 and FastAPI.
## Quickstart
Before using this repository!
Please replace the weight file /data/model/best.pt with your own trained model, unless you want to detect LPG inspection images.
## Installation
Build and start YOLOv8 with FASTAPI on http://localhost:9099
### Build
```docker-compose up```
### Rebuild
```docker-compose up --build```
## Directories
```
--/app
|--/data
|--/download # downloaded images
|--/predict # predicted images and json files
|--/model # weight file
```
## Usage
### Models
There are 2 Models in model.py:
```
# this is for user to auth
class User(BaseModel):
username: str
password: str
# this is for image to predict
class ImageToPredict(BaseModel):
type: str = 'url' # or 'base64'
url: str = None
base64: str = None
date: str = None
```
### API
#### Login
```
http://localhost:9099/token
```
#### Predict
```
http://localhost:9099/token
```
Accepts URL or base64 image, and returns the prediction result in JSON format.
## Response
```
{
"original_img": ,
"predict_img": ,
"result": result[0].tojson()
}
```
### Users
Users are stored in table ```users``` of ```./sysuser.sqlite```, and the default username and password are ```admin``` and ```admin```.
2401_87496566
- 粉丝: 972
- 资源: 5096
最新资源
- TOWER DEFENSE ZOMBIE WAR [1.01].zip
- GBT 27930 国标充电CAN报文解析 DBC文件
- 毕业设计基于C++和QT开发的智能售货系统(饮料售卖机)源码(高分毕设)
- TH2024005基于微信平台的文玩交易小程序ssm.zip
- java高校职工工资管理系统
- 零基础学AI-python语言:python基础语法(课件部分)
- IMT5G推进组发布5G无人机应用白皮书
- 基于Java SSM写的停车场管理系统,加入了车牌识别和数据分析
- 2025年P气瓶充装模拟考试卷
- 【java毕业设计】基于spring boot心理健康服务系统(springboot+vue+mysql+说明文档).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈