Skip to content

Instantly share code, notes, and snippets.

@GantMan
Last active March 23, 2020 14:45
Show Gist options
  • Save GantMan/4f4f21ef077fcee7fd6558d2ea72f353 to your computer and use it in GitHub Desktop.
Save GantMan/4f4f21ef077fcee7fd6558d2ea72f353 to your computer and use it in GitHub Desktop.
AI Lab Specs
<AILabPhoto
// Provide TFJS Model and info
modelInfo={{
model: myModel,
objectDetection: true,
labels: ['dog', 'cat'],
threshold: 0.4,
max: 20,
IOU: 0.5
}}
// Custom box componenet
objectDetectionComponent={MyCustomBoxComponent}
// Restrain keeps the image inside the AILabPhoto dimensions
// default true
restrain={false}
// Change the image to display exactly what the model will see as input
// this means resizing, rechanneling etc.
displayInputTensor
// Run code with result
onResult={console.log}
// Setting the source image (not using drag/drop)
source={someImage}
>
<p>CUSTOM INNER CONTENT!</p>
</AILabPhoto>
// Automatically looks at model input layer
// Adjusts incoming image to fit dims and channels
<AILabPhoto
// Provide TFJS Model
modelInfo={myModel}
// Run code with result
onResult={console.log}
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment