-
Notifications
You must be signed in to change notification settings - Fork 20
4d Places365
Hou Yujun edited this page Sep 17, 2024
·
2 revisions
The script classifies the type of scene or place depicted in each image, among over 400 place categories, utilising a VGG-16 model pretrained on the Places365 dataset.
Input
The input CSV should:
- have each row representing an image to process, and
- contain minimally two columns, named
uuid
andpath
, to specify image UUID and the local image file path, respectively
Output
One CSV that contains two columns: uuid
s and the inferred place category.
To reproduce sample_output
Modify run_scene_multiple.py
:
- Modify
out_Folder
: Insert the local ABSOLUTE PATH to thedocker/sample_output
folder - Modify
in_Folder
: Insert the local ABSOLUTE PATH to thedocker/input_csvs
folder - Modify
in_imgFolder
: Insert the local ABSOLUTE PATH to thedocker/input_imgs
folder
Make sure you cd
into the docker/
directory
Build the docker image:
docker build -t places365_image .
Run the following command after modifying the relevant paths as instructed:
docker run --rm --name places365_container --mount type=bind,source=insert-the-local-ABSOLUTE-PATH-to-the-code/download_imgs/sample_output/all-folder,target=insert-the-local-ABSOLUTE-PATH-to-the-docker/input_csvs-folder --mount type=bind,source=insert-the-local-ABSOLUTE-PATH-to-the-code/download_imgs/sample_output/all/1_50-folder,target=insert-the-local-ABSOLUTE-PATH-to-the-docker/input_imgs-folder --mount type=bind,source=insert-the-local-ABSOLUTE-PATH-to-the-docker/sample_output-folder,target=insert-the-local-ABSOLUTE-PATH-to-the-docker/sample_output-folder places365_image python run_scene_multiple.py; docker image rm places365_image
Modify run_scene_multiple.py
:
- Modify
input_filename
to the filename of your input csv including the .csv extension, e.g. input.csv - Modify
out_Folder
: Insert the local ABSOLUTE PATH to thedocker/sample_output
folder - Modify
in_Folder
: Insert the local ABSOLUTE PATH to thedocker/input_csvs
folder - Modify
in_imgFolder
: Insert the local ABSOLUTE PATH to thedocker/input_imgs
folder
Make sure you cd
into the docker/
directory
Build the docker image:
docker build -t places365_image .
Run the following command after modifying the relevant paths as instructed:
docker run --rm --name places365_container --mount type=bind,source=insert-the-local-ABSOLUTE-PATH-to-your-own-folder-that-contains-your-input-CSVs,target=insert-the-local-ABSOLUTE-PATH-to-the-docker/input_csvs-folder --mount type=bind,source=insert-the-local-ABSOLUTE-PATH-to-your-own-folder-that-contains-your-input-images,target=insert-the-local-ABSOLUTE-PATH-to-the-docker/input_imgs-folder --mount type=bind,source=insert-the-local-ABSOLUTE-PATH-to-your-own-output-folder,target=insert-the-local-ABSOLUTE-PATH-to-the-docker/sample_output-folder places365_image python run_scene_multiple.py; docker image rm places365_image
This part of our repo is modified from the original repo on Places365 by Zhou et al. (2017).