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
python -m pytest
Run certain test cases only:
python -m pytest ./tests/test_train.py::TestTrain
https://hub.docker.com/repository/docker/paulcccccch/robustar
Sample dataset and config Folder (Google Drive)
user-edit
: is a json of{<dataset_type>/<img_id>: <img_data>}
, where<dataset_type>
is usuallytrain
,<img_id>
is0
tolen(dataset) - 1
and<img_data>
is a comma-separated 1D array (in a string) of lengthimg_width * img_width * 4
(rgba representation of image, flattened). An example key-value paired is{"train/0": "124, 126, 54, 255, ..."}
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 pytorchImageFolder
. Check here for more details aboutImageFolder
/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 copyconfigs.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-
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.
-
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 typeL
to load. -
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.
-
After creating the file above with the specified contents, you need to reboot the system. After rebooting, you'll see the
/Robustar2
folder.