/shrec-sketches-helpers

Helpers for sketch-based 3D shape retrieval experiments (SHREC13, SHREC14, PART-SHREC14)

Primary LanguagePythonMIT LicenseMIT

shrec-sketches-helpers

Helper scripts for sketch-based 3D shape experiments.
Useful for rendering and pre-processing SHREC13, SHREC14 and PART-SHREC14 datasets.

Datasets

SHREC 2013 [website]
SHREC 2014 [website]

Image annotations

Run meta.py to create pandas dataframes for both datasets. There will be 2 dataframes per dataset: one for the sketches, one for the CAD models. Each entry in the dataframe consist of the filename path, the label and the split.

Word vectors

Run w2v.py to get the word vector for all class names. Word vectors are stored in a dictionary in a .npz file.

It requires the gensim library: conda install -c anaconda gensim

Blender 2D rendering

Following the MVCNN paper, render 12 views by placing the camera every 30 degrees, with an elevation of 30 degrees from the ground floor. This requires to modify the original phong.py script. Check this fork for more info.

It also requires the python blender package: conda install -c kitsune.one python-blender=2.79

Once everything is installed, run render.sh to render the 2D views for all CAD models.

Image pre-processing

Sketch resizing

Run resize_sk.py. Sketches will be resized to 256x256.

2D projection cropping and resizing

Run resize_cad.py. Images of 1024x1024 will be cropped with a margin of 100px, and resized to 256x256.

Citation

If you find these scripts useful, please consider citing our paper:

@article{
    Thong2020OpenSearch,
    title={Open Cross-Domain Visual Search},
    author={Thong, William and Mettes, Pascal and Snoek, Cees G.M.},
    journal={CVIU},
    year={2020},
    url={https://arxiv.org/abs/1911.08621}
}