OpenCV based visual logger for debugging,logging and testing image processing code
OpenCV based visual logger for debugging, logging and testing image processing code
Use the package manager pip to install foobar.
pip install opencv-log
Log \ Debug
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.png") # 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)
import cvtest as test # Process Image from image path def process_image(imagepath): if imagepath == "error.png": raise Exception("Some exception in processing image") img = cv2.imread(imagepath) return img test_image_paths=["example1.png","example1.png","error.png"] # This shows image using cv2.imshow, # On presssing 'y' key, it report it as PASS # On pressing any other key, it report it as FAIL and save output image for verification # On any exception, it report it as ERROR with exception stack test.report(test_image_paths, process_image)
import cvlog as log log.set_mode(log.Mode.DEBUG)
Set mode using ENV variable
os.environ['CVLOG_MODE'] = "DEBUG"
This is the default mode if we don't set mode.
Used in production. It neither creates HTML file nor shows an image.
Logs the image to interactive HTML to analyze the issue offline.
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
import cvlog as log log.set_level(log.Level.TRACE)
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
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size opencv_log-1.1.0-py3-none-any.whl (7.9 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|
|Filename, size opencv-log-1.1.0.tar.gz (7.4 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for opencv_log-1.1.0-py3-none-any.whl