Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dchaplinsky/visual-logging
A simple way to generate beautiful html logs with embedded images for CV purposes.
https://github.com/dchaplinsky/visual-logging
Last synced: about 2 months ago
JSON representation
A simple way to generate beautiful html logs with embedded images for CV purposes.
- Host: GitHub
- URL: https://github.com/dchaplinsky/visual-logging
- Owner: dchaplinsky
- License: mit
- Created: 2014-10-16T23:25:55.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-11-22T00:30:21.000Z (almost 2 years ago)
- Last Synced: 2024-07-12T10:26:58.249Z (2 months ago)
- Language: Python
- Size: 356 KB
- Stars: 120
- Watchers: 7
- Forks: 14
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
visual-logging
==============A simple way to generate beautiful html logs with embedded images for CV purposes.
visual-logging piggy backs on logging module and allows you to use sick power of logging to debug your computer vision application on a whole new level.
Now you can add OpenCV images (well technically it's numpy arrays), PIL images and matplotlib graphs to your logs.
You can read about it in details in a great blog post [visual-logging, my new favorite tool for debugging OpenCV and Python apps](http://www.pyimagesearch.com/2014/12/22/visual-logging-new-favorite-tool-debugging-opencv-python-apps/) written by Adrian Rosebrock
[![Build Status](https://travis-ci.org/dchaplinsky/visual-logging.svg?branch=master)](https://travis-ci.org/dchaplinsky/visual-logging)
[![Coverage Status](https://coveralls.io/repos/dchaplinsky/visual-logging/badge.png)](https://coveralls.io/r/dchaplinsky/visual-logging)## Installation
```pip install visual-logging```No extra dependencies
## Usage example (see demo.py)
```python
from logging import FileHandler
from vlogging import VisualRecordif __name__ == '__main__':
import cv2
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt# evenly sampled time at 200ms intervals
t = np.arange(0., 5., 0.2)fig1 = plt.figure()
plt.plot(t, t, 'r--', t, t ** 2, 'bs', t, t ** 3, 'g^')cv_image = cv2.imread('lenna.jpg')
pil_image = Image.open('lenna.jpg')import logging
logger = logging.getLogger("demo")
fh = FileHandler('test.html', mode="w")logger.setLevel(logging.DEBUG)
logger.addHandler(fh)logger.debug(VisualRecord(
"Hello from OpenCV", cv_image, "This is openCV image", fmt="png"))logger.info(VisualRecord(
"Hello from PIL", pil_image, "This is PIL image", fmt="jpeg"))logger.info(VisualRecord(
"Hello from pylab", fig1, "This is PyLab graph", fmt="png"))logger.warning(
VisualRecord("Hello from all", [cv_image, pil_image, fig1],
fmt="png"))```
You can check generated html [here](http://dchaplinsky.github.io/visual-logging/)