๐ฆ Dataloop Package Kit Examples
๐ Complete DPK Manifest Example
Here is an example of a complete DPK manifest.
NOTE: This is not supposed to be a real app, and publishing or installing it will probably result in some errors.
{
"name": "dpk-name",
"displayName": "DPK Display Name",
"version": "0.0.1",
"scope": "project",
"description": "Application description",
"codebase": {
"type": "git",
"gitUrl": "repo-url",
"gitTag": "0.0.1"
},
"components": {
"panels": [
{
"name": "PanelName",
"icon": "",
"supportedSlots": [
{
"type": "pipelineNodeConfig",
"configuration": {}
}
],
"conditions": {
"resources": []
}
}
],
"computeConfigs": [
{
"name": "compute-configs1",
"runtime": {
"podType": "highmem-xs",
"concurrency": 1,
"autoscaler": {
"type": "rabbitmq",
"minReplicas": 0,
"maxReplicas": 2
}
}
}
],
"modules": [
{
"name": "my-module",
"entryPoint": "my_entry_point.py",
"className": "ClassName",
"computeConfig": "compute-configs1",
"description": "Module Desciption",
"initInputs": [
{
"type": "DL Entity",
"name": "param name"
}
],
"functions": [
{
"name": "func1",
"input": [
{
"type": "DL Entity",
"name": "param name"
}
],
"output": [
{
"type": "DL Entity",
"name": "param name"
}
],
"displayName": "Function Display Name",
"displayIcon": "",
"description": "Function Description"
}
]
}
],
"models": [
{
"name": "model-name",
"moduleName": "my-module",
"scope": "project",
"status": "trained",
"configuration": {},
"description": "Model Description.",
"labels": []
}
],
"pipelineNodes": [
{
"panel": "PanelName",
"name": "Node Name",
"invoke": {
"type": "function",
"namespace": "my-service.my-module.func1"
},
"categories": [
"categoryName"
],
"scope": "node"
}
],
"services": [
{
"name": "my-service",
"panelNames": [
"PanelName"
],
"runtime": {
"podType": "regular-xs",
"concurrency": 10,
"autoscaler": {
"type": "rabbitmq",
"minReplicas": 0,
"maxReplicas": 2,
"queueLength": 10
}
}
}
],
"toolbars": [
{
"displayName": "Toolbar Display Name",
"invoke": {
"type": "function",
"namespace": "my-service.func1"
},
"location": "datasetBrowserApps",
"icon": ""
}
]
}
}
๐ฏ Real-World DPK Examples
Let's explore some production-ready examples from our public repository! Here are some magical DPKs you can use as inspiration:
๐ค AI Model Adapters
- Torch Models - Collection of PyTorch model adapters for various tasks
- NVIDIA Models - Integration with NVIDIA's AI model ecosystem
- Grounded SAM - Adapter for Segment Anything Model with grounding
๐ Pipeline & Data Processing
- Pipeline Templates - Ready-to-use pipeline templates for common workflows
- Dataset Clustering - Automated dataset organization using clustering techniques
- Data Split - Smart dataset splitting for training/validation/testing
- DTLPY Converters - Tools for converting between different annotation formats
๐ Integrations & Utilities
- Export GCS - Export and import annotations to Google Cloud Storage
- OpenCV Face Detection - Simple face detection implementation using OpenCV
๐ Dataset Management
- OSDAR23 Datasets - Example datasets and tools for the OSDAR challenge
๐ก Key Components in Real DPKs
Each of these DPKs demonstrates best practices for:
๐ Documentation
- Clear README files
- Installation instructions
- Usage examples
- API documentation
๐๏ธ Structure
- Well-organized code
- Proper manifest setup
- Clear dependency management
- Modular components
โ๏ธ Configuration
- Environment settings
- Runtime configurations
- Service definitions
- Panel layouts
๐งช Testing
- Test suites
- Example data
- Validation scripts
- Error handling
๐ฏ Example Use Cases
Here are some specific examples of how these DPKs are used:
1. Model Integration
{
"name": "yolov8-detector",
"components": {
"models": [
{
"name": "fasterrcnn",
"moduleName": "model-adapter",
"scope": "project",
"status": "trained",
"configuration": {
"weights_url": "best.pt"
}
}
]
}
}
2. Pipeline Node
{
"name": "data-splitter",
"components": {
"pipelineNodes": [
{
"name": "Split Dataset",
"invoke": {
"type": "function",
"namespace": "data-split.splitter.split_dataset"
},
"categories": ["data"]
}
]
}
}
3. Custom UI Panel
{
"name": "annotation-viewer",
"components": {
"panels": [
{
"name": "AnnotationPanel",
"supportedSlots": [
{
"type": "annotationStudio",
"configuration": {}
}
]
}
]
}
}
๐ Getting Started with Examples
To use any of these example DPKs:
- Clone the Repository
git clone https://github.com/dataloop-ai-apps/<dpk-name>
- Install Dependencies
pip install -r requirements.txt
- Configure the DPK
import dtlpy as dl
project = dl.projects.get('your-project')
dpk = project.dpks.push(src_path='path/to/dpk')
- Install the App
project.apps.install(dpk=dpk)
๐ก Pro Tips
- ๐ Study multiple examples to understand different patterns
- ๐ Look at the manifest structure of similar apps
- ๐งช Test configurations locally before publishing
- ๐ Document your customizations
- ๐ Keep your dependencies up to date
Need more inspiration? Visit our Dataloop Apps Space for the latest examples and updates! โจ