frank-xwang / InstanceDiffusion

[CVPR 2024] Code release for "InstanceDiffusion: Instance-level Control for Image Generation"

Home Page:https://people.eecs.berkeley.edu/~xdwang/projects/InstDiff/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to format scribble in demo json file?

mrwu-mac opened this issue · comments

Thank you for your outstanding work.
I try to format scribble with format [[x1,y1],[x2,y2],...], but got an error as follows,
scribbles_embeddings[idx] = torch.tensor(scribble) input.py line 72, in prepare_batch; RuntimeError: expand(torch.FloatTensor{[96, 2]}, size=[40]): the number of sizes provided (1) must be greater or equal to the number of dimensions in the tensor (2)

Hi, could you please provide an example of the scribble you used? Before you do that, it might be helpful to verify the format of the scribbles by referring to this line in our code, which generates scribbles randomly when none is provided:

if len(scribbles_list) == 0:

Based on the error message you shared, it appears that the scribble you provided does not conform to the format expected by our code.

The code used to randomly sample the points inside the scribble works for me. But manually giving scribble seems to get a different form of input, resulting in an error.

I have the same problem.

Sorry for the late reply. The scribble should be in the format of [x1, y1, ..., x20, y20]. Hope it helps!