https://github.com/jsmith/tensortools
A simple repository with my Python ML stuff
https://github.com/jsmith/tensortools
Last synced: 11 months ago
JSON representation
A simple repository with my Python ML stuff
- Host: GitHub
- URL: https://github.com/jsmith/tensortools
- Owner: jsmith
- License: mit
- Created: 2018-03-12T19:57:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-10-22T14:53:49.000Z (over 6 years ago)
- Last Synced: 2025-03-01T18:30:52.545Z (over 1 year ago)
- Language: Python
- Homepage: https://jsmith.github.io/tensortools/
- Size: 1.01 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://travis-ci.org/jsmith/tensortools)
[](https://tensortools.readthedocs.io/)
# TensorTools
A simple repository which implements common things I use in my ML projects so I don't have to repeat myself. See `examples/` for some examples which use this repository.
Better API documentation coming ASAP!
# Installation
```bash
pip install tensortools
```
# Example
```python
import tensorflow as tf
import tensortools as tt
import numpy as np
# Generate images with random shapes for object detection
image_generator = tf.generator.Generator()
images = image_generator.generate(n_images=1, height=100, width=100, max_shapes=2)
image = images[0]
tt.image.show(image)
# Some simple ops
vector = tt.ops.flatten(image, has_batch=False)
with tf.Session() as sess:
vector = sess.run([vector])
# Generate anchors for YOLO algorithm using KMeans
annotations = load_annotations()
anchors = tt.yolo.generate_anchors()
```