Skip to content

Latest commit

 

History

History
70 lines (45 loc) · 3.37 KB

README.md

File metadata and controls

70 lines (45 loc) · 3.37 KB

Robustar

To Run Backend

The versions of packages in requirements.txt have been verified to work with Python 3.9.

cd back-end # If you are not already in this folder
pip install -r requirements.txt
python server.py

To enable backend formatter for Python, run

pip install black

Run test cases

python -m pytest

Run certain test cases only:

python -m pytest ./tests/test_train.py::TestTrain

Robustar

https://hub.docker.com/repository/docker/paulcccccch/robustar

Sample dataset

Sample dataset and config Folder (Google Drive)

Notes

  • user-edit: is a json of {<dataset_type>/<img_id>: <img_data>}, where <dataset_type> is usually train, <img_id> is 0 to len(dataset) - 1 and <img_data> is a comma-separated 1D array (in a string) of length img_width * img_width * 4 (rgba representation of image, flattened). An example key-value paired is {"train/0": "124, 126, 54, 255, ..."}

Dev

Robustar reads from the following directories (absolute path, i.e. Robustar2 folder is placed immediatly under / of your file system. Specifically, for linux and MacOS, put the folder under / directory. For Windows, put it directly under the volumn your operating system is installed (usually C:).

  • /robustar2/checkpoint_images for pre-trained weights
  • /robustar2/dataset/train for training dataset. Each subfolder under this directory should contain images for a class, i.e. it should follow the format of pytorch ImageFolder. Check here for more details about ImageFolder
  • /robustar2/dataset/validation for validation dataset
  • /robustar2/dataset/test for test dataset
  • /robustar2/dataset/paired for paired dataset
  • /robustar2/influence_images for calculated influence images
  • /robustar2/user-edit.json for user edit.
  • /robustar2/configs.json for server configs. You directly may copy configs.json in the repository over.

You can download our example folder here Or use pip install gdown and gdown https://drive.google.com/uc?id=1WGicmBCHMFgLU70qwBTV4ffZ-RhpGKD-

For MacOS users

From Catalina version onwards, the root directory becomes read-only. This means it is not immediately possible to create new folders here. In order to get around that, the system provides what is known as synthetic firm links. This allows you to create what appears to be folders at the root of the file system.

  1. You need to create the file /etc/synthetic.conf, which should be owned by root and group wheel with permissions 0644.

    When you try to save this file using , you may encounter E212 Can't open file for writing.. Then you should use command :w !sudo tee % and type L to load.

  2. The contents in this file should look like this: Robustar2 absolute_path_to_Robustar2_folder

    NOTE: It is important to ensure that the space between the two folder names is a TAB character, and not just a number of space.

  3. After creating the file above with the specified contents, you need to reboot the system. After rebooting, you'll see the /Robustar2 folder.