What is CaptureGraph?#
CaptureGraph is a Python DSL for defining structured data capture procedures that execute on mobile devices. It separates the definition of a capture workflow from the execution, letting researchers design complex data collection without writing native code.
The Core Problem#
Traditional mobile data collection is often "naive"—users capture data indiscriminately, leading to:
- Diminishing returns from redundant samples
- Oversampling of convenient data points (e.g., noon lighting)
- User burnout from unclear guidance
The Solution#
CaptureGraph provides distribution-aware capture through:
- Importance Sampling: Guide users to capture only when statistically valuable
- Just-in-Time Instruction: Show future steps only when prerequisites are met
- Correct-by-Construction: Sessions are only valid if the full procedure completes
The Three Pillars#
CaptureGraph is an ecosystem of three interconnected components:
1. Procedure DSL (capturegraph-lib)#
Define capture workflows as Python code. See the Procedure DSL section for full documentation.
import capturegraph.procedures as cgp
def daily_capture():
target = cgp.GetRootDirectory()
session = target.new_session("daily")
return cgp.ProcedureSequence(
label="Daily Capture",
procedures=[
session.new_file("photo").save(cgp.CaptureImage(label="Today's Photo")),
session.new_file("notes").save(cgp.UserInputString(label="Notes")),
]
)
Procedures serialize to JSON and run on iOS devices. See procedure_to_json for serialization details.
2. CaptureGraph Server#
Hosts Capture Targets and orchestrates data collection:
- Tracks progress via
ProcedureManifest - Supports dynamic Python interceptors for custom notifications
- Enables collaborative capture across multiple users
3. CaptureGraph Sync#
Aggregates captured data to your local machine. See the CaptureGraph Sync section.
- Manifest-driven synchronization
- Hash-based integrity verification
- Efficient incremental downloads
Use Cases#
| Domain | Example |
|---|---|
| Environmental | Solar angle sampling for time-lapse |
| Spatial | Viewpoint coverage for 3D reconstruction |
| Clinical | Structured patient visit documentation |
| Process | Before/after state change observation |
Next Steps#
- Creating Your First Procedure — Build a simple capture workflow
- Deploying to Device — Serialize and import to iOS