SMALify icon indicating copy to clipboard operation
SMALify copied to clipboard

How do you make your own images work?

Open nightfarrow opened this issue 3 years ago • 1 comments

What is the process to convert your own images to a 3D mesh?

I got the demo working on the sample Stanford images, but when I try to run it on my own images I get errors.

For instance, I took this image . . . https://www.warrenphotographic.co.uk/photography/bigs/02679-Dog-jumping-white-background.jpg . . . and saved it as dogjump.jpeg in /home/s/SMALify/data/StanfordExtra/sample_imgs/n02099601-golden_retriever

then I changed config.py line from #SEQUENCE_OR_IMAGE_NAME = "stanfordextra:n02099601-golden_retriever/n02099601_176.jpg" to SEQUENCE_OR_IMAGE_NAME = "stanfordextra:n02099601-golden_retriever/dogjump.jpeg"

but when I run python smal_fitter/optimize_to_joints.py I get:


(smalifythis) s@s-To-be-filled-by-O-E-M:~/SMALify$ python smal_fitter/optimize_to_joints.py

** fvcore version of PathManager will be deprecated soon. **
** Please migrate to the version in iopath repo. **
https://github.com/facebookresearch/iopath 

Traceback (most recent call last):
  File "smal_fitter/optimize_to_joints.py", line 147, in <module>
    main()
  File "smal_fitter/optimize_to_joints.py", line 73, in main
    config.CROP_SIZE
  File "/home/s/SMALify/smal_fitter/data_loader.py", line 111, in load_stanford_sequence
    loaded_data = get_dog(image_name)
  File "/home/s/SMALify/smal_fitter/data_loader.py", line 97, in get_dog
    data = json_dict[name]
KeyError: 'n02099601-golden_retriever/dogjump.jpeg'

Is there a way to explain more the steps on how to prepare a custom image for the SMALify tool?

Also, do gifs work?

nightfarrow avatar Jan 01 '21 08:01 nightfarrow

You'll need to generate a segmentation mask + click keypoints for your input sequence before running the tool. Check the example StanfordExtra data for the kind of input the SMALify code expects. I recommend the LabelMe tool for doing this. This section in my README should get you started. The label file is here. Note the section in my readme is incomplete at the moment, but feel free to ask if you run into trouble.

benjiebob avatar Jan 01 '21 17:01 benjiebob