1
0
Fork 0
mirror of https://github.com/prise6/smart-iss-posts synced 2024-04-27 11:31:51 +02:00
smart-iss-posts/iss/clustering_debug.py
2019-11-16 18:30:08 +01:00

22 lines
765 B
Python

# -*- coding: utf-8 -*-
from iss.tools import Config
from iss.tools import Tools
from iss.models import SimpleConvAutoEncoder
from iss.clustering import ClassicalClustering
from dotenv import find_dotenv, load_dotenv
## Config
load_dotenv(find_dotenv())
cfg = Config(project_dir = os.getenv("PROJECT_DIR"), mode = os.getenv("MODE"))
## charger le modèle
model_type = 'simple_conv'
cfg.get('models')[model_type]['model_name'] = 'model_colab'
model = SimpleConvAutoEncoder(cfg.get('models')[model_type])
## Générateur d'image
filenames = Tools.list_directory_filenames('data/processed/models/autoencoder/train/k/')
generator_imgs = Tools.generator_np_picture_from_filenames(filenames, target_size = (27, 48), batch = 496, nb_batch = 2)
## Générer des images