forked from rai-project/mlmodelscope
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Add support for video input types * feat: Added Output for videoClassification Modality * chore/ refactored SCSS to use className instead of element tags. * Refactor SampleInputsTab to use onSampleInputClickPreview for handling sample video input clicks
- Loading branch information
1 parent
5f7f588
commit a947882
Showing
27 changed files
with
544 additions
and
84 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import React from "react"; | ||
import "./QuickVideoInput.scss"; | ||
import Task from "../../../helpers/Task"; | ||
import useQuickInputControl from "./useQuickInputControl"; | ||
import useBEMNaming from "../../../common/useBEMNaming"; | ||
import { QuickInputTabContent } from "./QuickInputTabContent"; | ||
import { QuickInputTabTitle } from "./QuickInputTabTitle"; | ||
import { QuickInputType } from "./quickInputType"; | ||
|
||
export default function QuickVideoInput(props) { | ||
const { | ||
tabIsSelected, | ||
selectedInputs, | ||
addInput, | ||
getTabs, | ||
removeInput, | ||
selectTab, | ||
selectInput, | ||
runModel, | ||
} = useQuickInputControl(props); | ||
const { getBlock, getElement } = useBEMNaming("quick-video-input"); | ||
|
||
const task = Task.getStaticTask(props.model.output.type); | ||
const tabs = getTabs(QuickInputType.Video); | ||
|
||
return ( | ||
<div className={getBlock()}> | ||
{!props.hideHeader && ( | ||
<> | ||
<h2 className={getElement("title")}>Try this model</h2> | ||
<div className={getElement("subtitle")}>{task.inputText}</div> | ||
</> | ||
)} | ||
<div className={getElement("tabs")}> | ||
<div className={getElement("tab-titles")} role="tablist"> | ||
{tabs.map((tab, index) => ( | ||
<QuickInputTabTitle | ||
key={index} | ||
tab={tab} | ||
index={index} | ||
tabIsSelected={tabIsSelected} | ||
selectTab={selectTab} | ||
getElement={getElement} | ||
/> | ||
))} | ||
</div> | ||
{tabs.map((tab, index) => ( | ||
<QuickInputTabContent | ||
key={index} | ||
tab={tab} | ||
index={index} | ||
getElement={getElement} | ||
{...props} | ||
removeInput={removeInput} | ||
addInput={addInput} | ||
selectInput={selectInput} | ||
tabIsSelected={tabIsSelected} | ||
selectedInputs={selectedInputs} | ||
/> | ||
))} | ||
</div> | ||
<button | ||
className={getElement("run-model")} | ||
disabled={selectedInputs.length === 0 || selectedInputs[0] === ""} | ||
onClick={() => runModel()} | ||
> | ||
Run model and see results | ||
</button> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@import "../../../App"; | ||
|
||
.quick-video-input { | ||
@include tabs; | ||
@include quick-input-container; | ||
|
||
&__subtitle { | ||
@include body; | ||
margin-top: 8px; | ||
} | ||
|
||
&__run-model { | ||
@include primaryButtonWithIcon("after", "arrow-right-white.svg"); | ||
|
||
align-items: center; | ||
align-self: flex-end; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
margin-top: 24px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 12 additions & 8 deletions
20
src/components/Experiment/QuickInput/Tabs/URLInput/URLInputPreview.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
.url-inputs-preview { | ||
width: 100%; | ||
margin: 20px auto; | ||
} | ||
|
||
img { | ||
margin: 10px auto; | ||
display: block; | ||
} | ||
&__img { | ||
margin: 10px auto; | ||
display: block; | ||
} | ||
|
||
&__audio { | ||
margin: 10px auto; | ||
display: block; | ||
} | ||
|
||
audio { | ||
margin: 10px auto; | ||
display: block; | ||
&__video { | ||
max-width: min(100%, 1000px); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ export const QuickInputType = { | |
Text: "text", | ||
Audio: "audio", | ||
Document: "document", | ||
} | ||
Video: "video", | ||
}; |
Oops, something went wrong.