add anime segmentation

This commit is contained in:
Qing
2023-05-09 19:07:12 +08:00
parent 7fcce78e40
commit e5ac6a105a
11 changed files with 510 additions and 5 deletions

View File

@@ -687,6 +687,15 @@ export default function Editor() {
}
}, [runRenderablePlugin])
useEffect(() => {
emitter.on(PluginName.AnimeSeg, () => {
runRenderablePlugin(PluginName.AnimeSeg)
})
return () => {
emitter.off(PluginName.AnimeSeg)
}
}, [runRenderablePlugin])
useEffect(() => {
emitter.on(PluginName.GFPGAN, () => {
runRenderablePlugin(PluginName.GFPGAN)

View File

@@ -147,7 +147,7 @@ const Header = () => {
}}
accept="image/png, image/jpeg"
/>
Mask
M
</Button>
</label>

View File

@@ -6,6 +6,7 @@ import {
ChevronRightIcon,
FaceIcon,
HobbyKnifeIcon,
PersonIcon,
MixIcon,
} from '@radix-ui/react-icons'
import { useToggle } from 'react-use'
@@ -20,6 +21,7 @@ import Button from '../shared/Button'
export enum PluginName {
RemoveBG = 'RemoveBG',
AnimeSeg = 'AnimeSeg',
RealESRGAN = 'RealESRGAN',
GFPGAN = 'GFPGAN',
RestoreFormer = 'RestoreFormer',
@@ -32,6 +34,10 @@ const pluginMap = {
IconClass: HobbyKnifeIcon,
showName: 'RemoveBG',
},
[PluginName.AnimeSeg]: {
IconClass: PersonIcon,
showName: 'Anime Segmentation',
},
[PluginName.RealESRGAN]: {
IconClass: BoxModelIcon,
showName: 'RealESRGAN 4x',
@@ -46,7 +52,7 @@ const pluginMap = {
},
[PluginName.InteractiveSeg]: {
IconClass: CursorArrowRaysIcon,
showName: 'Interactive Seg',
showName: 'Interactive Segmentation',
},
[PluginName.MakeGIF]: {
IconClass: GifIcon,