diffusers.js
diffusers.js copied to clipboard
Pose Estimation & Semantic Segmentation Annotator Models
Description
The changes include adding the Pose Estimation & Semantic Segmentation Annotator models along with the pre-processing functions required to get the ControlNet input image which is done using OpenCV.js.
Specific Changes
- Add
examples/react/src/annotator_helper_functions.ts
file which contains necessary functions to run both models. - Add Annotator model and Annotator config upload elements in
examples/react/src/App.tsx
. - Modify
uploadImage()
function inexamples/react/src/App.tsx
to account for Pose Estimation & Semantic Segmentation.
Notes
- Pose Estimation was taken from here.
- Semantic Segmentation was taken from here.
- The Pose Estimation and Semantic Segmentation models can be downloaded from here.
- Getting the annotated image takes ~17s with Semantic Segmentation and 17-24s with Pose Estimation (depends on the selected model) on an M2 Max.
- The annotator files must be uploaded before uploading the ControlNet image.
- I'll submit an issue asking if it's possible to convert all the Annotator models to ONNX which would give us access to every ControlNet model in JavaScript.