ludimation / harlequin

Puppeteering the internet.
MIT License
1 stars 1 forks source link

setup — hashmap (or DB Table) to associate filenames with image labels #16

Open ludimation opened 9 years ago

ludimation commented 9 years ago

The way the system is currently set up, the index of images in the images directory is used to store training data for that image. This means that any time you add more images to the image directory, the installation would have to be re-trained.

If, however, we figure out a way to associate filenames with numerical image labels, the number of images in the directory can change and the associated training data will remain relevant and intact as long as the image name isn't changed.

(will have to filter out images that are no longer around from joint data so system doesn't try to display images that no longer exist)

caipre commented 9 years ago

I'm not certain what you were going for with the "decimal representations of binary ASCII codes," but straightforward solution is to use a HashMap (or DB table) that maps the training data label to an image name.

ludimation commented 9 years ago

Cleaned up the description of this one.

ludimation commented 9 years ago

Seems like here might be an elegant way to use a combination of ofToHex(), ofHexToString() and ofHexToInt() to convert file names between string and int formats through their hex values. That is, set labels based on a simple conversion of the data type from string to int, and loading images would be a reverse of that conversion. Special characters in filenames might throw the conversions off, so we could also create a script that renames files in the images directory that have any special characters which would throw off the string < > int conversions.

ludimation commented 9 years ago

Using c++ atoi() might also be quick: http://www.cplusplus.com/forum/general/13135/

ludimation commented 9 years ago

hash table http://www.cplusplus.com/reference/unordered_map/unordered_map/