Coder Social home page Coder Social logo

swayhrl / fractaldb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hirokatsukataoka16/fractaldb-pretrained-resnet-pytorch

0.0 1.0 0.0 357 KB

Pretraining without Natural Images (ACCV 2020 Oral)

License: MIT License

Shell 5.77% Python 94.23%

fractaldb's Introduction

FractalDB

Summary

The repository contains a fractal category search and FractalDB renderer in Python. The paper is based on the paper:

Hirokatsu Kataoka, Kazushige Okayasu, Asato Matsumoto, Eisuke Yamagata, Ryosuke Yamada, Nakamasa Inoue, Akio Nakamura and Yutaka Satoh, "Pre-training without Natural Images", Asian Conference on Computer Vision (ACCV), 2020. (Best Paper Honorable Mention Award) [Project] [PDF] [Dataset] [Oral] [Poster]

Citation

If you use this code, please cite the following paper:

@inproceedings{KataokaACCV2020,
  author={Kataoka, Hirokatsu and Okayasu, Kazushige and Matsumoto, Asato and Yamagata, Eisuke and Yamada, Ryosuke and Inoue, Nakamasa and Nakamura, Akio and Satoh, Yutaka},
  title={Pre-training without Natural Images},
  booktitle={Asian Conference on Computer Vision (ACCV)},
  year={2020},
}

Requirements

  • Python 3 (worked at 3.7)

Execution file

We prepared execution file exe.sh in the top directory. The execution file contains our recommended parameters. Please type the following commands on your environment.

chmod +x exe.sh
./exe.sh

Fractal Category Search

Run the code param_search/ifs_search.py to create fractal categories and their representative images. In our work, the basic parameters are --rate 0.2 --category 1000 --numof_point 100000

python param_search/ifs_search.py --rate=${fillrate} --category=${numof_category} --numof_point=${numof_point}  --save_dir=${save_dir}

The folder structure is constructed as follows.

./
  data/
    csv_rate20_category1000/
      00000.csv
      00001.csv
      ...
    rate20_category1000/
      00000.png
      00001.png
      ...
  param_search/
  ...

FractalDB Construction

Run the code fractal_renderer/make_fractaldb.py to construct FractalDB.

python fractal_renderer/make_fractaldb.py

The code includes the following parameters.

--load_root: Category root with CSV file. You can find in "./data".
--save_root: Create the directory of FractalDB.)
--image_size_x: x-coordinate image size 
--image_size_y: y-coordinate image size
--pad_size_x: x-coordinate padding size
--pad_size_y: y-coordinate padding size
--iteration: #dot/#patch in a fractal image
--draw_type: Rendering type. You can select "{point, patch}_{gray, color}"
--weight_csv: Weight parameter. You can find "./fractal_renderer/weights"
--instance: #instance. 10 -> 1000 instances per category, 100 -> 10,000 instances per category')

Moreover, we prepared a script of multi-thread processing in the execution file. Please change the comment-out in the part of execution file as follows.

''' <- Comment-out the single-thread FractalDB creation
# Create FractalDB
python fractal_renderer/make_fractaldb.py \
    --load_root='./data/csv_rate'${fillrate}'_category'${numof_category} --save_root='./data/FractalDB-'${numof_category} \
    --image_size_x=${imagesize} --image_size_y=${imagesize} --iteration=${numof_ite} --draw_type=${howto_draw} \
    --weight_csv='./fractal_renderer/weights/weights_'${weight}'.csv'
'''

# Multi-thread processing
for ((i=0 ; i<40 ; i++))
do
    python fractal_renderer/make_fractaldb.py \
        --load_root='./data/csv_rate'${fillrate}'_category'${numof_category}'_parallel/csv'${i} \
        --save_root='./data/FractalDB-'${numof_category} --image_size_x=${imagesize} --image_size_y=${imagesize} \
        --iteration=${numof_ite} --draw_type=${howto_draw} --weight_csv='./fractal_renderer/weights/weights_'${weight}'.csv' &
done
wait

The number (40) means 40 threads in processing. Please change the number and structure in data/csv_rate0.2_category1000_parallel.

The structure of rendered FractalDB is constructed as follows.

./
  data/
    FractalDB-1000/
      00000/
        00000_00_count_0_flip0.png
        00000_00_count_0_flip1.png
        00000_00_count_0_flip2.png
        00000_00_count_0_flip3.png
        ...
      00001/
        00001_00_count_0_flip0.png
        00001_00_count_0_flip1.png
        00001_00_count_0_flip2.png
        00001_00_count_0_flip3.png
        ...
  ...

fractaldb's People

Contributors

hirokatsukataoka16 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.