How kazuhito00/image-processing-node-editor works
Project type and purpose
• This is a desktop image-processing “node editor” application written in Python.
• Key technologies: dearpygui for the GUI, OpenCV for classical image ops, onnxruntime for DL inference, Mediapipe/filterpy for specialized nodes, plus a plugin-style node architecture.
File structure
• Top level:
• main.py: application entry point
• node/…: all node implementations, grouped by category (input_node, process_node, deep_learning_node, analysis_node, draw_node, other_node, preview_release_node)
• node_editor/: GUI and graph-editor code (node_editor.py, util.py, setting.json)
• docker/: Dockerfiles to containerize the app with GPU support
• setup.py, requirements.txt: packaging and dependencies
• Patterns:
• Plugin architecture: each node category is a folder of self-contained modules.
• MVC/Event-driven: node_editor acts as View/Controller, core graph (in main.py and node_abc.py) acts as Model.
• Each node inherits from a base (node/node_abc.py) and is dynamically discovered/instantiated.
Insights from README
• The README enumerates dozens of node types, showing purpose, I/O types, and dependencies.
• Usage instructions highlight command-line flags, Docker support, and pip packaging.
• Emphasis on extensibility: adding new nodes requires dropping a new module under the node/ hierarchy.
a. Main components:
• GUI Layer (node_editor): DearPyGui-based graph editor UI
• Core Graph Engine:
– Node Manager/Factory: discovers/imports node classes
– Graph Data Model: stores nodes, links, execution order
– Scheduler/Executor: runs node update loops (async or sync)
• Node Modules: categorized plugins
– Input Nodes (video, image, webcam, RTSP, values)
– Deep Learning Nodes (classification, detection, enhancement, pose, etc.)
– Analysis Nodes (FPS, histograms, BRISQUE)
– Other/Preview Nodes (switch, writer, MOT, code exec, screen capture)
• Compute Libraries:
– OpenCV (cv2) for traditional image processing
– ONNX Runtime for model inference
– Mediapipe & Protobuf for certain DL nodes
– filterpy for MOTpy nodes
• Persistence & I/O: JSON export/import of graph configs, VideoWriter for output files
• CLI & Docker packaging (optional deployment containers)
b. Relationships and interactions
• GUI <--> Core Engine:
– GUI emits “create node”, “connect pins”, “delete node” events
– Core Engine updates the graph model, triggers re-execution
– Engine pushes processed frames back to GUI for display
• Core Engine --> Node Modules:
– For each node in execution order, Engine calls node.update(inputs)
– Node uses Compute Libraries (OpenCV, ONNX, etc.) to process and returns outputs
• Node Modules <--> Compute Libraries:
– Deep-learning nodes load ONNX models from disk and call onnxruntime
– Process nodes invoke OpenCV functions (cv2.blur, cv2.Canny, etc.)
• Persistence: Engine serializes graph state (nodes, parameters, connections) to JSON; can load it back
c. Architectural patterns & principles
• Plugin / Factory pattern: node discovery and instantiation at runtime
• MVC or MVVM: separating GUI (View) from graph model and execution logic
• Strategy pattern: each node encapsulates its own algorithm/behavior
• Event-driven & observer pattern: graph changes trigger re-computation/display updates
• Containerization: Docker directory for reproducible GPU-accelerated environments
d. Key technologies, frameworks, libraries
– Python 3.x
– dearpygui (GUI)
– OpenCV (cv2)
– onnxruntime-gpu
– Mediapipe, Protobuf
– filterpy, MOTpy, Norfair (tracking)
– JSON (graph export/import)
– Docker (nvidia-gpu support)
– setuptools (setup.py), pip