Getting Started
Lenscraft is a no/low-code tool to create computer vision pipelines. Build your vision pipeline using a node based visual editor. Lenscraft is ideal for rapid prototyping or for quickly solving simple vision tasks. The vision pipeline is created and tested using a graphical user interface and then saved to a file. The pipeline is integrated in your code using the Lenscraft library. Load the saved pipeline and run on your images.
Installation
Install from pypi
pip install lenscraft
Lenscraft is currently not available on pypi. It can be installed from a .whl. To access the latest version please reach out and ask nicely :) You can reach us at gmagnusson at fraunhofer dot org.
pip install lenscraft-1.4.1-py3-none-any.whl
Lenscraft works with Python 3.10+.
Lenscraft depends on OpenCV and scikit-image.
CLI
Lenscraft has a command line interface for some actions.
Run the GUI
lenscraft
To run the GUI with a specific project file
lenscraft -f /path/to/project.json
Graphical User Interface
Lenscraft will open in a new window on your desktop. You will be prompted to create a project by giving it a name. A Lenscraft project is just a json file that stores all the information about your vision pipeline.
The top horizontal row is where all images in your project will be displayed. This is your
Image Library. You can add images by either pressing the big "Add" button or with File ->
Add Image
.
In the node editor below you will see two nodes. The ImageLibrary node and Output node. These will always be present and cannot be deleted.
The ImageLibrary node is the starting point of your image processing pipeline. In a production setting this might be a frame from a camera. During development you can select one image from your library to focus on. All steps of the pipeline will shown for that one image. You can change the image you want to focus on at any time.
The Output node is the end of you image processing pipeline. It is the result you want to get out. Whatever value is passed into the output node will be returned as the result in your runtime integration script.
To add nodes to you pipeline, right click anywhere on the node editor (the grid) and choose a node from the popup window.
To connect nodes, click and drag from one yellow dot to another. A link will be created,
which represents a value being passed from one processing step to another. You can remove
a link by Ctrl + Click
on a link.
Unfortunately you can not zoom in or out in the node editor, but you can pan around using the middle mouse button.
More details about the user interface will be provided in the UI section section.
Result visualization
The Lenscraft UI will attempt to preview the output given to the Output Node as an overlay over the image library. The visualization depends on the output data type.
When you click the "Run" button in the top-left corner of the window
Plugins
You can add custom code to your pipelines using plugins. See the Plugin section for details.
Runtime Integration
Lenscraft provides a UI to create and debug vision pipelines, but they are only useful if you can actually run them in a production setting. Lenscraft is also a library that you can use to load vision pipelines and run as part your codebase.
import lenscraft as lc
pipeline = lc.load_pipeline("path/to/my/vision/pipeline.json")
for frame in frames:
result = pipeline.run(frame)
The result returned from the run
method is whatever value is passed to the output node.
See the Runtime section for details.