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

issue with get_images function #24

Open
jiaxx opened this issue Sep 12, 2013 · 0 comments
Open

issue with get_images function #24

jiaxx opened this issue Sep 12, 2013 · 0 comments

Comments

@jiaxx
Copy link
Contributor

jiaxx commented Sep 12, 2013

There was a problem using get_images() to generate images for the objectome models (but not others). The output images sometimes look like part of an image. Also the object is not always presented at the desired position of the image, if there is any.

Here is my code:

First, I define a class in dataset.py:

class GenerativeDataset_rotation(GenerativeDatasetBase):

models =["pear_obj_2","single_pineapple","lo_poly_animal_CHICKDEE","lo_poly_animal_DUCK","lo_poly_animal_ELE_AS1","lo_poly_animal_RHINO_2","lo_poly_animal_TRTL_B","lo_poly_animal_TRANTULA"]
bad_backgrounds = ['INTERIOR_13ST.jpg', 'INTERIOR_12ST.jpg',
'INTERIOR_11ST.jpg', 'INTERIOR_10ST.jpg',
'INTERIOR_09ST.jpg', 'INTERIOR_08ST.jpg',
'INTERIOR_07ST.jpg', 'INTERIOR_06ST.jpg',
'INTERIOR_05ST.jpg']
good_backgrounds = [_b for _b in model_info.BACKGROUNDS
if _b not in bad_backgrounds]
templates = [
{'n_ex_per_model': 1,
'name': 'rotation', 
'template': {'bgname': choice(good_backgrounds),
'bgscale': 1.,
'bgpsi': 0,
'bgphi': 40.,
's': 1,
'ty': 0,
'tz': 0,
'ryz': choice([-160, -70, 0, 70, 160]),
'rxy': choice([-160, -70, 0, 70, 160]),
'rxz': choice([-160, -70, 0, 70, 160]),
}
}
]

Use genthor to generat meta and then images

import genthor.datasets as gd

dataset = gd.GenerativeDataset_rotation()
meta=dataset.meta

preproc = {'dtype':'uint8', 'size':(1024, 1024), 'normalize':False, 'mode':'L'}
im = dataset.get_images(preproc, 
#global_light_spec=[{'name': 'bgalight', 'type': 'AmbientLight', 'color':(1,1,1,.01)}]
global_light_spec=None)

fig = plt.figure(figsize=(6, 6))
ax = plt.imshow(im[0][::-1], cmap='gray')

index4
index3
index2
index

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant