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

i put in a triangle and got a weird result #3

Open
JadeKim042386 opened this issue Jun 15, 2023 · 0 comments
Open

i put in a triangle and got a weird result #3

JadeKim042386 opened this issue Jun 15, 2023 · 0 comments

Comments

@JadeKim042386
Copy link

JadeKim042386 commented Jun 15, 2023

Triangle Sequence

  • points: (0, 0), (10, 10), (20, 0)
NodeOp(label=<EntityType.External: 7>, parameters={})
NodeOp(label=<EntityType.Line: 1>, parameters={'isConstruction': False, 'dirX': 0.7071067811865475, 'dirY': 0.7071067811865475, 'pntX': 5.0, 'pntY': 5.0, 'startParam': -7.0710678118654755, 'endParam': 7.0710678118654755})
NodeOp(label=<SubnodeType.SN_Start: 101>, parameters={})
NodeOp(label=<SubnodeType.SN_End: 102>, parameters={})
EdgeOp(label=<ConstraintType.Subnode: 101>, references=(1, 2), parameters={})
EdgeOp(label=<ConstraintType.Subnode: 101>, references=(1, 3), parameters={})
NodeOp(label=<EntityType.Line: 1>, parameters={'isConstruction': False, 'dirX': 0.7071067811865475, 'dirY': -0.7071067811865475, 'pntX': 15.0, 'pntY': 5.0, 'startParam': -7.0710678118654755, 'endParam': 7.0710678118654755})
NodeOp(label=<SubnodeType.SN_Start: 101>, parameters={})
NodeOp(label=<SubnodeType.SN_End: 102>, parameters={})
EdgeOp(label=<ConstraintType.Subnode: 101>, references=(4, 5), parameters={})
EdgeOp(label=<ConstraintType.Subnode: 101>, references=(4, 6), parameters={})
NodeOp(label=<EntityType.Line: 1>, parameters={'isConstruction': False, 'dirX': 1.0, 'dirY': 0.0, 'pntX': 10.0, 'pntY': -0.0, 'startParam': -10.0, 'endParam': 10.0})
NodeOp(label=<SubnodeType.SN_Start: 101>, parameters={})
NodeOp(label=<SubnodeType.SN_End: 102>, parameters={})
EdgeOp(label=<ConstraintType.Subnode: 101>, references=(7, 8), parameters={})
EdgeOp(label=<ConstraintType.Subnode: 101>, references=(7, 9), parameters={})
NodeOp(label=<EntityType.Stop: 8>, parameters={})
EdgeOp(label=<ConstraintType.Coincident: 0>, references=(3, 5), parameters={})
EdgeOp(label=<ConstraintType.Coincident: 0>, references=(6, 9), parameters={})
EdgeOp(label=<ConstraintType.Coincident: 0>, references=(8, 2), parameters={})

image

Save

import sketchgraphs.data as datalib
from SketchGraphs.sketchgraphs.data.flat_array import save_list_flat, pack_dictionary_flat, FlatSerializedArray
sketch = datalib.sketch_from_sequence(sequence)
array = save_list_flat([sketch])
flatArray = FlatSerializedArray.from_flat_array(array)
data = {"sequences": flatArray}
np.save('test.npy', pack_dictionary_flat(data))

Run

python SketchConcept/train.py -d ./Data/ -e experiment_directory/sample_pretrain_exp --train_file test.npy -v True -c 180

Check param_GT during running

# batch_prim_param_GT
tensor([[ 0, 39, 39, 39, 39, -1],
        [ 0, 39, 39, 39, 39, -1],
        [ 0, 39, 39, 39, 39, -1]])
# batch_const_param_GT
tensor([[-1, -1, -1, -1, -1],
        [-1, -1, -1, -1, -1],
        [-1, -1, -1, -1, -1]])
# batch_const_param_type_GT
tensor([[-1, -1],
        [-1, -1],
        [-1, -1]])

Result visulaization

python plot_interactive_visualize.py -d ./Data/ -e experiment_directory/sample_pretrain_exp --train_file test.npy --epoch 181

image

+ in cpu

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