semvec/pypi-packages huggingface dataset:
keras-model-extract 0.0.2
Utility to extract TensorFlow/Keras model structure and iterate through it
Requires Python: >=3.6

# Keras Model Extract

This is a small utility library to access Keras/TensorFlow model's structure/tree and do stuff with it.

Currently there isn't a straight-forward way to do this without manually going through the model layers.

It currently supports:

- Model tree iteration (BFS-like)
- Accessing node parents, node children, node output type
- Accessing source layers

Node properties:

- `children`: children nodes (sub-layers)
- `parent_names`: unique names of parent nodes
- `shape`: layer output shape
- `name`: unique layer name (from TF/Keras)
- `__layer`: reference to the instance of the layer (if `include_layer_ref` is `True`)

How it works:

- It creates a pure Python tree clone of your model which is easy to walk through.

# Installation

This package has no depenedencies.

```
pip install keras-model-extract
```

# Example use

This examples show how to iterate through a model and print all the nodes.

```
>>> from keras_model_extract import copy_model_tree, iterate
>>> from keras.applications.vgg16 import VGG16
>>> model = VGG16()
>>> nodes = copy_model_tree(model)
>>> nodes
{'input_1': input_1, 'block1_conv1': block1_conv1, 'block1_conv2': block1_conv2, 'block1_pool': block1_pool, 'block2_conv1': block2_conv1, 'block2_conv2': block2_conv2, 'block2_pool': block2_pool, 'block3_conv1': block3_conv1, 'block3_conv2': block3_conv2, 'block3_conv3': block3_conv3, 'block3_pool': block3_pool, 'block4_conv1': block4_conv1, 'block4_conv2': block4_conv2, 'block4_conv3': block4_conv3, 'block4_pool': block4_pool, 'block5_conv1': block5_conv1, 'block5_conv2': block5_conv2, 'block5_conv3': block5_conv3, 'block5_pool': block5_pool, 'flatten': flatten, 'fc1': fc1, 'fc2': fc2, 'predictions': predictions}
>>> nodes['input_1'].children
[block1_conv1]
>>> nodes['block4_pool'].parent_names
['block4_conv3']
>>> nodes['block4_pool'].shape
(None, 14, 14, 512)
>>> iterate(nodes['input_1'], lambda layer: print(layer))
input_1
block1_conv1
block1_conv2
block1_pool
block2_conv1
block2_conv2
block2_pool
block3_conv1
block3_conv2
block3_conv3
block3_pool
block4_conv1
block4_conv2
block4_conv3
block4_pool
block5_conv1
block5_conv2
block5_conv3
block5_pool
flatten
fc1
fc2
predictions

```
imkin 0.2.5
Lightweight a movie and TV series data parser from imdb.com and kinopoisk.ru
Keywords: parser imdb kinopoisk

Lightweight a movie and TV series data parser like title, alternate title, release date, runtime, age rating and episode titles for TV series from imdb.com and kinopoisk.ru without using third-party packages. Wget will be used for the kinopoisk parser, so Linux like only.

Install:

    pip install imkin

Examples:

    import imkin
    
    film = imkin.new('https://www.imdb.com/title/tt0068646/')
    
    print(film.title)
    
    print(film.alternate)
    
    print(film.year)
    
    print(film.time)
    
    print(film.age)
    
    print(film.url)
    
    
    film = imkin.new('https://www.imdb.com/title/tt2356777/')
    
    print(film)
    
    print(film.s(1).ep(1))
    
    
    result = imkin.search('Fargo')
    
    print(result)