Skip to content

metahashorg/iconhash_py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Icon Hash

image1

We are making a DCGAN to generate newer variants of Planets (link to training dataset) from random noise inputs.

This Convolutional Generative Adversarial Network consists of two different networks, the generator and the discriminator. The Generator tries to generate images from random noise, while the Discriminator tries to distinguish real images from the generated ones.

The Generator model includes a block of layers consisting of Batchnormalization, upsampling followed by a convolution with relu activation. There are 4 such blocks used tanh function as the activation of the convolution layer. The Discriminator model is a simple deep convolution network. The combined model is compiled adam optimizer (learning rate = 0.0002), with binary cross entropy loss.

The training process for 7000 first iterations is shown in this gif below:

Dependencies

pip install
  • Python 3
  • Numpy
  • Hashlib
  • Pandas
  • Scipy
  • Keras 2.0.6+
  • TensorFlow 1.2.1+

Usage

# iconhash.py script requires generator.json (generator network structure) 
# and gen.h5 (network weights) files, 
# they should be stored at the same folder as the main script.
cd Script

# To generate a 128x128 planet icon for the Parameter1 address using DCGAN 
# and to store it in the Parameter2 directory run the following
.../python iconhash.py parameter1 parameter2
Parameter1 could be one of the following:
  • a Metahash Address (0x0083504341c15f066955c2ac999b356894cde5c20f5a0ee9ac)
  • file.tsv a file containing several Metahash Addresses
  • file.txt a file containing several Metahash Addresses
Parameter2
  • Output folder
Outputs
  • The script returns a unique planet picture as a png file with a resolution of 128x128 for every Metahash Address from input (ex. 0x0083504341c15f066955c2ac999b356894cde5c20f5a0ee9ac.png)

Example

cd Script
python iconhash.py example.txt ./Example/

If example.txt contains 10 Metahash Addresses generated by crypt_example.py (https://github.com/metahashorg/crypt_example_py), then after running the above commands, 10 png pictures will be generated and saved in the ./Example folder. One for every Metahash Address from example.txt file.

image_test_all

Misprint test

Let's check that generator returns completely different pictures in case of a misprint. We slightly changed addresses (just one or two symbols) and generated icons for them.

test addresses and the icons respectively:

0x002cfbe84acd405627302b35c081c36f8ebafb4df075ad9f70 0x002cfbe84acd405627302b35c081c36f8obafb4df075ad9f70 0x002cfbe84acd405627302b35c081c36f8odafb4df075ad9f70 0x002cfbe84acd405627302b35c0e1c36f8ebafb4df075ad9f70 0x002cfbe84acd405627302b35c0e7c36f8ebafb4df075ad9f70 0x002cfbe84acd405627302b35o081c36f8ebafb4df075ad9f70 0x002cfbe84acd405627302b85c081c36f8ebafb4df075ad9f70 0x002cfbe84acd4O5627302b35c081c36f8ebafb4df075ad9f70 0x002cfbe85acd405627302b35c081c14f8ebafb4df075ad9f70 0x002cfbe85acd405627302b35c081c36f8ebafb4df075ad9f70

image_test_mistake

About

Icon Hash by Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages