OpenCV based visual logger for debugging,logging and testing image processing code
Project description
opencv-log
OpenCV based visual logger for debugging, logging and testing image processing code
Usage
import cvlog as log
# Set default mode and level
# If we dont set, then default mode is NONE
# and the default level is ERROR
log.set_mode(log.Mode.LOG)
log.set_level(log.Level.TRACE)
# image read using opencv
img = cv2.imread("sample.img")
# log or show the image or do nothing based on
# the current mode and current level
log.image(log.Level.INFO, img)
log.image(log.Level.ERROR, img)
log.image(log.Level.TRACE, img)
Modes
import cvlog as log
log.set_mode(log.Mode.DEBUG)
Set mode using ENV variable
os.environ['CVLOG_MODE'] = "DEBUG"
Mode.NONE (Default)
This is the default mode if we don't set mode.
Used in production. It neither creates HTML file nor shows an image.
Mode.LOG
Logs the image to interactive HTML to analyze the issue offline.
Mode.DEBUG
Shows the image using cv2.imshow
instead of logging to debug steps in the development.
It on move on to next log step on pressing any key and exit the code on pressing ESC
Levels
import cvlog as log
log.set_level(log.Level.TRACE)
or
os.environ['CVLOG_MODE'] = "TRACE"
- Level.ERROR (Default) - Log or Show only ERROR level
- Level.INFO - Log or Show INFO and ERROR level
- Level.TRACE - Log or Show TRACE, INFO and ERROR level steps
Level valid for DEBUG and LOG mode
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
opencv-log-1.0.0.tar.gz
(6.8 kB
view hashes)
Built Distribution
Close
Hashes for opencv_log-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7a97a139900427a35024ca4e1cc76ba0adec4014dc954854e3325261d15065d |
|
MD5 | c6f5716915212ce1fff11b75da23eba1 |
|
BLAKE2b-256 | 6a62364eae2b3c4505a3957be4aef1be51014ba4ced6089bb2d801b18ba6eeba |