Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Load/Save for GenerativeImage Class #33

Closed
1 task done
sadrasabouri opened this issue Sep 30, 2021 · 2 comments · Fixed by #72
Closed
1 task done

Data Load/Save for GenerativeImage Class #33

sadrasabouri opened this issue Sep 30, 2021 · 2 comments · Fixed by #72
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@sadrasabouri
Copy link
Collaborator

sadrasabouri commented Sep 30, 2021

Description

You can make a unique Samila art with a pair of function and a random seed. Also you can plot your art with different configurations like projection, color and etc.

It would be nice if we have a config parameter which initialize some settings for desired art (with the lower priority against other parameter i.e replaced by them). It could be JSON file like bellow:

{
"f1": "random.uniform(-1, 1) * y + math.cos(x ** 2)",
"f2": "random.uniform(-1, 1) * x**2 + math.sin(y)",
"generate":
    {
    "seed": 10
    },
"plot":
    {
    "projection": Projection.POLAR
    }
}

which makes a unique picture (bellow):
Figure_5

Steps/Code to Reproduce

>>> g = GenerativeImage(config=path2JSON)

Expected Behavior

Generate the Samila art based on given configs.

Samila Version (Use : samila.__version__)

0.1

Tasks

  • save_config method
@sadrasabouri
Copy link
Collaborator Author

We decided to save configs as pickles instead of JSONs.

@sadrasabouri sadrasabouri mentioned this issue Oct 19, 2021
@sadrasabouri
Copy link
Collaborator Author

Due to some issues related to function serialization we decided to just save the data instead of functions.
So the functions would be save_data and load_data and we can save the data to a JSON file and then load the JSON anytime we want to construct a Samila option by passing file address or io.IOBase to data when initiating.

In case of loading the data when initiating Samila we can not use generate fucntion because of absence of functions.

@sadrasabouri sadrasabouri changed the title Config File For GenerativeImage Class Data Load/Save for GenerativeImage Class Oct 22, 2021
sadrasabouri added a commit that referenced this issue Oct 22, 2021
@sepandhaghighi sepandhaghighi linked a pull request Nov 9, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants