Refer to the docs
This README is the copy of the front page of the docs site and some sections are not properly rendered.
I am more than welcome to work for adding new models or features! If you have a model in pytorch or tensorflow, feel free to create an issue or new discussion stating which model or what feature you want from this repository!
For model addition, links to the implementation or some working inference code definitely helps me to add the model and inference code.
This repository offers
- Models: Trained state-of-the-art models for various vision tasks in ONNXRuntime backend
- No-Code Modules: Easy interface to use those models for both prediction and visualizing output. No coding is needed. The interface is universal among all models in this library.
- Extentiability: Customizable modules to use it for applications such as realtime inference.
Install directly from this repository.
$cd BiWAKO
$pip install -e .
!!! warning Downloading from pip server is currently suspended in order to protect weight files. We will update it soon.
No matter which model you use, these interface is the same.
import BiWAKO
# 1. Initialize Model
model = BiWAKO.MiDAS(model="mono_depth_small")
# 2. Feed Image (accept cv2 image or path to the image)
prediction = model.predict(image_or_image_path)
# 3. Visiualize result as a cv2 image
result_img = model.render(prediction, image_or_image_path)
More specifically...
- Instantiate model with
BiWAKO.ModelName(weight)
. TheModelName
andweight
corresponding to the task you want to work on can be found at the table in the next section. Weight file is automaticaly downloaded. - call
predict(image)
.image
can be either path to the image or cv2 image array. - call
render(prediction, image)
.prediction
is the return value ofpredict()
method andimage
is the same as above. Some model takes optional arguments to control details in the output.
We also provides some APIs to even accelerate productions. See API page for further details/
The following list is the current availability of models with weight variations.
Click the link at the model column for futher documentation.
Task | Model | Weights |
---|---|---|
Mono Depth Prediction | MiDAS | mono_depth_small mono_depth_large |
Salient Object Detection | U2Net | mobile basic human_seg portrait |
Super Resolution | RealESRGAN | super_resolution4864 super_resolution6464 |
Object Detection | YOLO2/YOLO | Please refer to docs for details |
Emotion Prediction | FerPlus | ferplus8 |
Human Parsing | HumanParsing | human_attribute |
Denoise | HINet | denoise_320_480 |
Face Detection | YuNet | yunet_120_160 |
Style Transfer | AnimeGAN | animeGAN512 |
Image Classification | ResNetV2 | resnet18v2 resnet50v2 resnet101v2 resnet152v2 |
Human Portrait Segmentation | MODNet | modnet_256 |
Semantic Segmentation | FastSCNN | fast_scnn384 fast_scnn7681344 |
Diver's View Segmentation | SUIMNet | suim_net_3248 suim_rsb_72128 suim_vgg_25632 suim_vgg_72128 |
It is extremely easy to use BiWAKO at application layer.
Any model can be used in the same way to run real-time inference.
Like the above example, you can build simple Backend API for inference on web server. We have prepared sample deployment of the library with FastAPI.Read this for details.
We also provides pre-defined video prediction API. Read this for details