Skip to content

Commit

Permalink
Chore: Readme and import updates (#31)
Browse files Browse the repository at this point in the history
* Updating readme and fixing some incorrect imports

* Incorrect input
  • Loading branch information
walkingtowork authored Jul 15, 2024
1 parent 03c1ac9 commit a3bba0e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 14 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ The project is structured as follows:
## Recommended Workflow for creating new Tasks (WIP)
- Add the task name to `TaskIDs.js`. Use camelcase for the variable and snakecase for the string
- Make a new directory in `Outputs` and make:
- Make a new directory in `Outputs` and create:
- `testData` subdirectory
- `testTaskNameOutput.js`
- `TaskNameOutput.js`
- `TaskName.stories.js`
- `TaskName.scss`
Expand All @@ -97,9 +98,13 @@ The project is structured as follows:
- `getDefaultModel`
- Open `DefaultModels.js` and copy/paste one of the existing models (editing where appropriate)
- `getSampleOutput`
- Returne the `Test[Task Name]Output` that you created in `testData` above
- Return the `Test[Task Name]Output` that you created in `testData` above
- `getStaticTasks`
- Create a new story for the task in `QuickInput.stories.js`
- If the user is able to upload files for this task, add the task to `UppyFileTypeCheckerPlugin`
- Add the new task to `ModelDetailPage` in `getSampleInputs` and `getInputType`
- If you need to test the upload dashboard, open `useUploadInputControl` and find the text `UNCOMMENT THIS BEFORE COMMITTING` and comment it out.
- If you need to check the array of inputs that you are submitting, add an `onRunModelClicked` function to your task in `QuickInput.stories.js` (it takes the inputs as a param)
## Adding new Task icons
- Go to svgrepo.com, search for a suitable icon, download it, and drag the file into the `src/resources/icons` directory
Expand Down
3 changes: 3 additions & 0 deletions src/components/Experiment/QuickInput/QuickInput.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ ImageTo3D.args = {
type: imageTo3D,
},
},
onRunModelClicked: (inputs) => {
console.log('inputs: ', inputs)
}
};

export const Text = Template.bind({});
Expand Down
27 changes: 19 additions & 8 deletions src/components/Experiment/QuickOutput/QuickOutput.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
textClassification,
imageToText,
audioClassification,
textToImage,
} from "../../../helpers/TaskIDs";
import ObjectDetection from "./Outputs/ObjectDetection/ObjectDetection";
import ImageEnhancement from "./Outputs/ImageEnhancement/ImageEnhancement";
Expand All @@ -42,7 +43,10 @@ import TextToVideoOutput from "./Outputs/TextToVideo/TextToVideoOutput";
import TextToImageOutput from "./Outputs/TextToImage/TextToImageOutput";
import TextClassificationOutput from "./Outputs/TextClassification/TextClassificationOutput";
import ImageToTextOutput from "./Outputs/ImageToText/ImageToTextOutput";
import { AudioToText, ImageTo3D, TextTo3D } from "../QuickInput/QuickInput.stories";
import ImageTo3DOutput from "./Outputs/ImageTo3D/ImageTo3DOutput";
import TextTo3DOutput from "./Outputs/TextTo3D/TextTo3DOutput";
import AudioToTextOutput from "./Outputs/AudioToText/AudioToTextOutput";
import TextToAudioOutput from "./Outputs/TextToAudio/TextToAudioOutput";
import AudioClassificationOutput from "./Outputs/AudioClassification/AudioClassificationOutput";

const defaultProps = {
Expand Down Expand Up @@ -120,7 +124,7 @@ export default function QuickOutput(givenProps) {
);
case imageTo3D:
return (
<ImageTo3D
<ImageTo3DOutput
onBackClicked={props.onBackClicked}
trial={props.trialOutput}
/>
Expand All @@ -141,9 +145,9 @@ export default function QuickOutput(givenProps) {
);
case audioToText:
return (
<AudioToText
<AudioToTextOutput
onBackClicked={props.onBackClicked}
trial={props.trialOutput}
trial={props.trialOutput}
/>
);
case textConversation:
Expand Down Expand Up @@ -174,6 +178,13 @@ export default function QuickOutput(givenProps) {
trial={props.trialOutput}
/>
);
case textToImage:
return (
<TextToImageOutput
onBackClicked={props.onBackClicked}
trial={props.trialOutput}
/>
)
case textToVideo:
return (
<TextToVideoOutput
Expand All @@ -183,16 +194,16 @@ export default function QuickOutput(givenProps) {
);
case textToAudio:
return (
<TextToImageOutput
<TextToAudioOutput
onBackClicked={props.onBackClicked}
trial={props.trialOutput}
trial={props.trialOutput}
/>
);
case textTo3D:
return (
<TextTo3D
<TextTo3DOutput
onBackClicked={props.onBackClicked}
trial={props.trialOutput}
trial={props.trialOutput}
/>
);
case imageToText:
Expand Down
9 changes: 6 additions & 3 deletions src/components/ModelDetailPage/ModelDetailPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
documentQuestionAnswering,
textToImage,
textToVideo,
textTo3D,
} from "../../helpers/TaskIDs";
import {
SampleImageClassificationInputs,
Expand All @@ -37,7 +38,8 @@ import {
SampleDocumentQuestionAnsweringInputs,
SampleTextToImage,
SampleTextToVideo,
SampleImageTo3DInputs
SampleImageTo3DInputs,
SampleTextTo3DInputs
} from "../../helpers/sampleImages"; // This file should be renamed

const ModelDetailPage = (props) => {
Expand Down Expand Up @@ -76,6 +78,8 @@ const ModelDetailPage = (props) => {
return SampleTextToImage;
case textToVideo:
return SampleTextToVideo;
case textTo3D:
return SampleTextTo3DInputs;
case image_classification:
default:
return SampleImageClassificationInputs;
Expand All @@ -88,10 +92,9 @@ const ModelDetailPage = (props) => {
case audioClassification:
return "audio";
case textToText:
return "text";
case textToCode:
return "text";
case textConversation:
case textTo3D:
return "text";
case object_detection:
case image_enhancement:
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/Task.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export default class Task {
name: "Image to 3D",
description: "Convert a 2D image or collection of images into a 3D model",
id: imageTo3D,
multiple: false,
multiple: true,
useMultiInput: true,
inputs: [
{
Expand Down

0 comments on commit a3bba0e

Please sign in to comment.