First, clone the repo to local machine. Navigate to the root of the repo.
Assuming the machine has a Nvidia GPU, first, Nvidia Container Runtime is needed.
Then, spin up a docker container using, update the path accordingly:
sudo docker run --gpus all --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 -it --rm --net=host --runtime nvidia -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix -v <PATH_CONTAINING_ULTRAFLWR>/UltraFlwr:/UltraFlwr nvcr.io/nvidia/pytorch:24.05-py3
In the docker container, cd
to \UltraFlwr
.
Install Dependencies:
apt update
apt install lsof
pip install prettytable==3.12.0 flwr==1.14.0 ultralytics==8.3.53 opencv-python==4.8.0.74
In the setup.py
, remove the contents in install_requires
.
Check FedYOLO/config.py
to see the default configurations, especially regarding BASE
, DATASET_NAME
, and NUM_CLIENTS
.
If you are running docker following the command provided, BASE
needs to be empty.
Lastly, install FedYOLO with pip install -e .
cd
into the datasets folder:cd datasets
- Make a directory for a specific dataset:
mkdir pills
cd
into the dataset folder:cd pills
- Get data-set from Roboflow
- Create a directory for the client specific datasets:
mkdir partitions
- Create the partitions
- Go to the base of the clone:
cd ../../
- Create the splits:
python FedYOLO/data_partitioner/fed_split.py
- To choose the dataset, change the
DATASET_NAME
parameter in theFedYOLO/config.py
file
- Create the splits:
Follow the style of roboflow downloads as mentioned in above steps.
For one-off: ./scripts/run.sh
For multiple Runs, reference: bash scripts/federated_train_and_test/benchmark.sh
For normal YOLO training on entire server dataset and client data partitions: bash scripts/central_train_and_test/run_local_train_and_test.sh