cuiaiyu / dressing-in-order

(ICCV'21) Official code of "Dressing in Order: Recurrent Person Image Generation for Pose Transfer, Virtual Try-on and Outfit Editing" by Aiyu Cui, Daniel McKee and Svetlana Lazebnik
https://cuiaiyu.github.io/dressing-in-order
Other
507 stars 126 forks source link

NameError: name 'circle' is not defined #89

Closed srssethuraman closed 11 months ago

srssethuraman commented 11 months ago

The NameError you encountered indicates that the function circle is not defined in the current scope where the error occurred. This typically happens when the required function is not imported or not imported correctly.

In this case, it seems that the circle function from the skimage.draw module is being used in the draw_pose_from_cords function inside the pose_utils.py module, but it is not properly imported.

To fix this issue, you need to ensure that the circle function is correctly imported in the pose_utils.py module. You can do this by adding the following import statement at the beginning of the pose_utils.py file:

NameError Traceback (most recent call last)

in () 6 # generate 7 pimg, gimgs, oimgs, gen_img, pose = dress_in_order(model, pid, pose_id=pose_id) ----> 8 plot_img(pimg, gimgs, oimgs, gen_img, pose) 2 frames in plot_img(pimg, gimgs, oimgs, gen_img, pose) 26 import utils.pose_utils as pose_utils 27 print(pose.size()) ---> 28 kpt = pose_utils.draw_pose_from_map(pose.cpu().numpy().transpose(1,2,0),radius=6) 29 kpt = kpt[0] 30 if not isinstance(pimg, list): /content/dressing-in-order/utils/pose_utils.py in draw_pose_from_map(pose_map, threshold, **kwargs) 98 def draw_pose_from_map(pose_map, threshold=0.1, **kwargs): 99 cords = map_to_cord(pose_map, threshold=threshold) --> 100 return draw_pose_from_cords(cords, pose_map.shape[:2], **kwargs) 101 102 /content/dressing-in-order/utils/pose_utils.py in draw_pose_from_cords(pose_joints, img_size, radius, draw_joints) 89 if pose_joints[i][0] == MISSING_VALUE or pose_joints[i][1] == MISSING_VALUE: 90 continue ---> 91 yy, xx = circle(joint[0], joint[1], radius=radius, shape=img_size) 92 colors[yy, xx] = COLORS[i] 93 mask[yy, xx] = True NameError: name 'circle' is not defined
cuiaiyu commented 11 months ago

Please use scikit-image==0.16.2

srssethuraman commented 11 months ago

I have installed scikit-image==0.16.2 version successfully unfortunately i can't access the name 'circle' alone. please help me

GALACTICLIMOS commented 7 months ago

this guy on youtube has this code successfully running, i asked for help and he fixed these issues for me https://www.youtube.com/watch?v=pRJppKDsZWA&t=37s

cuiaiyu commented 7 months ago

This is fixed by the most recent pull request #93

If you still have probably with scikit-image==0.16.2, you can use the latest scikit-image in this way to get rid of the error: https://github.com/cuiaiyu/dressing-in-order/pull/94/files