diff --git a/lama_cleaner/app/src/components/CoffeeIcon/CoffeeIcon.tsx b/lama_cleaner/app/src/components/CoffeeIcon/CoffeeIcon.tsx index 7e62c76..bb7d830 100644 --- a/lama_cleaner/app/src/components/CoffeeIcon/CoffeeIcon.tsx +++ b/lama_cleaner/app/src/components/CoffeeIcon/CoffeeIcon.tsx @@ -1,7 +1,5 @@ import React, { useState } from 'react' -import { useRecoilState } from 'recoil' import { Coffee } from 'react-feather' -import { settingState } from '../../store/Atoms' import Button from '../shared/Button' import Modal from '../shared/Modal' diff --git a/lama_cleaner/app/src/components/Editor/Editor.tsx b/lama_cleaner/app/src/components/Editor/Editor.tsx index 68b6521..b3d8f5d 100644 --- a/lama_cleaner/app/src/components/Editor/Editor.tsx +++ b/lama_cleaner/app/src/components/Editor/Editor.tsx @@ -57,6 +57,7 @@ import emitter, { import FileSelect from '../FileSelect/FileSelect' import InteractiveSeg from '../InteractiveSeg/InteractiveSeg' import InteractiveSegConfirmActions from '../InteractiveSeg/ConfirmActions' +import InteractiveSegReplaceModal from '../InteractiveSeg/ReplaceModal' const TOOLBAR_SIZE = 200 const MIN_BRUSH_SIZE = 10 @@ -114,6 +115,7 @@ export default function Editor() { isInteractiveSegRunningState ) + const [showInteractiveSegModal, setShowInteractiveSegModal] = useState(false) const [interactiveSegMask, setInteractiveSegMask] = useState(null) // only used while interactive segmentation is on @@ -573,6 +575,7 @@ export default function Editor() { if (isInteractiveSeg) { onInteractiveCancel() + return } if (isDraging || isMultiStrokeKeyPressed) { @@ -1036,9 +1039,13 @@ export default function Editor() { () => { if (!isInteractiveSeg) { setIsInteractiveSeg(true) + if (interactiveSegMask !== null) { + setShowInteractiveSegModal(true) + } } }, - isInteractiveSeg + {}, + [isInteractiveSeg, interactiveSegMask] ) // Standard Hotkeys for Brush Size @@ -1173,6 +1180,7 @@ export default function Editor() { style={{ left: `${x}px`, top: `${y}px`, + // transform: 'translate(-50%, -50%)', }} > @@ -1359,7 +1367,12 @@ export default function Editor() { tooltipPosition="top" icon={} disabled={isInteractiveSeg || isInpainting} - onClick={() => setIsInteractiveSeg(true)} + onClick={() => { + setIsInteractiveSeg(true) + if (interactiveSegMask !== null) { + setShowInteractiveSegModal(true) + } + }} /> + + + + ) +} + +export default InteractiveSegReplaceModal diff --git a/lama_cleaner/interactive_seg.py b/lama_cleaner/interactive_seg.py index c0c4a73..94d7876 100644 --- a/lama_cleaner/interactive_seg.py +++ b/lama_cleaner/interactive_seg.py @@ -154,7 +154,7 @@ class ISPredictor(object): INTERACTIVE_SEG_MODEL_URL = os.environ.get( "INTERACTIVE_SEG_MODEL_URL", - "/Users/qing/code/github/ClickSEG/clickseg_pplnet.pt", + "https://github.com/Sanster/models/releases/download/clickseg_pplnet/clickseg_pplnet.pt", )