https://github.com/tae898/room-classification
192
I got data from here. You should apply for permission first. Download it and name it as data.
You can download a pretrained model from here. It's a fine-tuned EfficientNet-b3 using pytorch-lightning
pip install -r requirements.txtexplore-data.ipynb to explore dataset.train.py to train.
train.py [-h] [--seed SEED] [--batch-size BATCH_SIZE] [--image-size IMAGE_SIZE] [--limit-data LIMIT_DATA] [--num-classes NUM_CLASSES] [--data-dir DATA_DIR] [--efficientnet EFFICIENTNET] [--epochs EPOCHS]
[--use-gpu] [--precision PRECISION] [--patience PATIENCE]
evaluation.py to evaluate and see some samples.This Flask server is implemented in app.py. It receives an image and outputs a
probability distribution over the seven room types (i.e., interior, bathroom, bedroom, exterior, living_room, kitchen, and dining_room).
There are two ways to run the server. You can either run it natively in Python or as a docker container. The docker way is recommended.
The docker way (recommended)
docker run -it --rm -p 10005:10005 --gpus all tae898/room-classification-cuda
docker run -it --rm -p 10005:10005 tae898/room-classification
Running natively in Python (GPUs are supported)
model.ckpt and place it in the root repo directory.python app.py
The Python client sends an image to the server. This image is either an image saved in your disk or your webcam stream.
pip install -r requirements-client.txt
Run the room-classifier on the image saved in your disk:
python client.py --mode image --image-path path/to/the/image.jpg
This will save the results at path/to/the/image.jpg.json. It'll look something like this:
"interior": 0.0012067470233887434,
"bathroom": 0.004016552586108446,
"bedroom": 0.9945330619812012,
"exterior": 9.643802059144946e-07,
"living_room": 0.00022632408945355564,
"kitchen": 9.742022484715562e-06,
"dining_room": 6.571232916030567e-06
Run the room-classifier on webcam:
python client.py --mode webcam

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
git checkout -b feature/AmazingFeature)make style && quality in the root repo directory, to ensure code quality.git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)Content type
Image
Digest
Size
4.4 GB
Last updated
over 4 years ago
docker pull tae898/room-classification-cuda