All Projects â†’ zcemycl â†’ TF2DeepFloorplan

zcemycl / TF2DeepFloorplan

Licence: GPL-3.0 license
TF2 Deep FloorPlan Recognition using a Multi-task Network with Room-boundary-Guided Attention. Enable tensorboard, quantization, flask, tflite, docker, github actions and google colab.

Programming Languages

python
139335 projects - #7 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to TF2DeepFloorplan

labml
🔎 Monitor deep learning model training and hardware usage from your mobile phone đŸ“±
Stars: ✭ 1,213 (+1137.76%)
Mutual labels:  tensorboard, keras-tensorflow, tensorflow2
G-SimCLR
This is the code base for paper "G-SimCLR : Self-Supervised Contrastive Learning with Guided Projection via Pseudo Labelling" by Souradip Chakraborty, Aritra Roy Gosthipaty and Sayak Paul.
Stars: ✭ 69 (-29.59%)
Mutual labels:  keras-tensorflow, tensorflow2
tf-faster-rcnn
Tensorflow 2 Faster-RCNN implementation from scratch supporting to the batch processing with MobileNetV2 and VGG16 backbones
Stars: ✭ 88 (-10.2%)
Mutual labels:  keras-tensorflow, tensorflow2
book-ml
æ›žç±ă€Œä»Šă™ăè©Šă—ăŸă„ïŒæ©Ÿæą°ć­Šçż’ăƒ»æ·±ć±€ć­Šçż’ïŒˆăƒ‡ă‚ŁăƒŒăƒ—ăƒ©ăƒŒăƒ‹ăƒłă‚°ïŒ‰ç”»ćƒèȘè­˜ăƒ—ăƒ­ă‚°ăƒ©ăƒŸăƒłă‚°ăƒŹă‚·ăƒ”ă€ăźă‚œăƒŒă‚čă‚łăƒŒăƒ‰ă‚’é…ćžƒă™ă‚‹ăƒŹăƒă‚žăƒˆăƒȘです。
Stars: ✭ 29 (-70.41%)
Mutual labels:  keras-tensorflow, google-colab
potato-disease-classification
Potato Disease Classification - Training, Rest APIs, and Frontend to test.
Stars: ✭ 95 (-3.06%)
Mutual labels:  keras-tensorflow, tensorflow2
GLOM-TensorFlow
An attempt at the implementation of GLOM, Geoffrey Hinton's paper for emergent part-whole hierarchies from data
Stars: ✭ 32 (-67.35%)
Mutual labels:  keras-tensorflow, tensorflow2
Text and Audio classification with Bert
Text Classification in Turkish Texts with Bert
Stars: ✭ 34 (-65.31%)
Mutual labels:  keras-tensorflow, tensorflow2
gcnn keras
Graph convolution with tf.keras
Stars: ✭ 47 (-52.04%)
Mutual labels:  keras-tensorflow, tensorflow2
TF2-RL
Reinforcement learning algorithms implemented for Tensorflow 2.0+ [DQN, DDPG, AE-DDPG, SAC, PPO, Primal-Dual DDPG]
Stars: ✭ 160 (+63.27%)
Mutual labels:  tensorboard, tensorflow2
deepvac
PyTorch Project Specification.
Stars: ✭ 507 (+417.35%)
Mutual labels:  tensorboard, quantization
Tensorflowtts
😝 TensorFlowTTS: Real-Time State-of-the-art Speech Synthesis for Tensorflow 2 (supported including English, French, Korean, Chinese, German and Easy to adapt for other languages)
Stars: ✭ 2,382 (+2330.61%)
Mutual labels:  tflite, tensorflow2
ImmunoLynk
[Lumiata COVID-19 Winner] COVID Immunity testing results registered to the Blockchain for healthcare safety.
Stars: ✭ 17 (-82.65%)
Mutual labels:  image-recognition, keras-tensorflow
LIGHT-SERNET
Light-SERNet: A lightweight fully convolutional neural network for speech emotion recognition
Stars: ✭ 20 (-79.59%)
Mutual labels:  tflite, tensorflow2
GradCAM and GuidedGradCAM tf2
Implementation of GradCAM & Guided GradCAM with Tensorflow 2.x
Stars: ✭ 16 (-83.67%)
Mutual labels:  keras-tensorflow, tensorflow2
E2E-Object-Detection-in-TFLite
This repository shows how to train a custom detection model with the TFOD API, optimize it with TFLite, and perform inference with the optimized model.
Stars: ✭ 28 (-71.43%)
Mutual labels:  tflite, tensorflow2
word-embeddings-from-scratch
Creating word embeddings from scratch and visualize them on TensorBoard. Using trained embeddings in Keras.
Stars: ✭ 22 (-77.55%)
Mutual labels:  tensorboard, tensorflow2
Labml
🔎 Monitor deep learning model training and hardware usage from your mobile phone đŸ“±
Stars: ✭ 508 (+418.37%)
Mutual labels:  tensorboard, keras-tensorflow
Pneumonia Detection From Chest X Ray Images With Deep Learning
Detecting Pneumonia in Chest X-ray Images using Convolutional Neural Network and Pretrained Models
Stars: ✭ 64 (-34.69%)
Mutual labels:  image-recognition, keras-tensorflow
Lua Curlv3
Lua binding to libcurl
Stars: ✭ 197 (+101.02%)
Mutual labels:  curl
Wttr.in
⛅ The right way to check the weather
Stars: ✭ 16,345 (+16578.57%)
Mutual labels:  curl

TF2DeepFloorplan License: GPL v3 example workflow Coverage Status Hits

This repo contains a basic procedure to train and deploy the DNN model suggested by the paper 'Deep Floor Plan Recognition using a Multi-task Network with Room-boundary-Guided Attention'. It rewrites the original codes from zlzeng/DeepFloorplan into newer versions of Tensorflow and Python.
Network Architectures from the paper,

Requirements

Install the packages stated in requirements.txt, including matplotlib,numpy,opencv-python,pdbpp, tensorflow-gpu and tensorboard.
The code has been tested under the environment of Python 3.7.4 with tensorflow-gpu==2.3.0, cudnn==7.6.5 and cuda10.1_0. Used Nvidia RTX2080-Ti eGPU, 60 epochs take approximately 1 hour to complete.

How to run?

  1. Install packages via pip and requirements.txt.
python -m venv venv
source venv/bin/activate
pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
  1. According to the original repo, please download r3d dataset and transform it to tfrecords r3d.tfrecords. Friendly reminder: there is another dataset r2v used to train their original repo's model, I did not use it here cos of limited access. Please see the link here zlzeng/DeepFloorplan#17.
  2. Run the train.py file to initiate the training, model checkpoint is stored as log/store/G and weight is in model/store,
python dfp/train.py [--batchsize 2][--lr 1e-4][--epochs 1000]
[--logdir 'log/store'][--modeldir 'model/store']
[--saveTensorInterval 10][--saveModelInterval 20]
  • for example,
python dfp/train.py --batchsize=8 --lr=1e-4 --epochs=60
--logdir=log/store --modeldir=model/store
  1. Run Tensorboard to view the progress of loss and images via,
tensorboard --logdir=log/store
  1. Convert model to tflite via convert2tflite.py.
python dfp/convert2tflite.py [--modeldir model/store]
[--tflitedir model/store/model.tflite]
[--quantize]
  1. Download and unzip model from google drive,
gdown https://drive.google.com/uc?id=1czUSFvk6Z49H-zRikTc67g2HUUz4imON # log files 112.5mb
unzip log.zip
gdown https://drive.google.com/uc?id=1tuqUPbiZnuubPFHMQqCo1_kFNKq4hU8i # pb files 107.3mb
unzip model.zip
gdown https://drive.google.com/uc?id=1B-Fw-zgufEqiLm00ec2WCMUo5E6RY2eO # tfilte file 37.1mb
unzip tflite.zip
  1. Deploy the model via deploy.py, please be aware that load method parameter should match with weight input.
python dfp/deploy.py [--image 'path/to/image']
[--postprocess][--colorize][--save 'path/to/output_image']
[--loadmethod 'log'/'pb'/'tflite']
[--weight 'log/store/G'/'model/store'/'model/store/model.tflite']

  • for example,
python dfp/deploy.py --image floorplan.jpg --weight log/store/G
--postprocess --colorize --save output.jpg --loadmethod log

Docker for API

  1. Build and run docker container. (Please train your weight, google drive does not work currently due to its update.)
docker build -t tf_docker -f Dockerfile .
docker run -d -p 1111:1111 tf_docker:latest
docker run --gpus all -d -p 1111:1111 tf_docker:latest
  1. Call the api for output.
curl -H "Content-Type: application/json" --request POST  \
  -d '{"uri":"https://cdn.cnn.com/cnnnext/dam/assets/200212132008-04-london-rental-market-intl-exlarge-169.jpg","colorize":1,"postprocess":0, "output":"/tmp"}' \
  http://0.0.0.0:1111/process --output /tmp/tmp.jpg


curl --request POST -F "file=@resources/30939153.jpg;type=image/jpeg" \
  -F "postprocess=0" -F "colorize=0" -F "output=/tmp" http://0.0.0.0:1111/process --output out.jpg
  1. If you run app.py without docker, the second curl for file upload will not work.

Google Colab

  1. Click on and authorize access.
  2. Run the first code cell for installation.
  3. Go to Runtime Tab, click on Restart runtime. This ensures the packages installed are enabled.
  4. Run the rest of the notebook.

Deep Floorplan package

  1. Install as a package.
pip install -e .
python setup.py test
coverage run ./setup.py test
  1. Import as a package.
import dfp
from dfp import net, data
model = net.deepfloorplanModel()
  1. Uninstall package. pip uninstall Deep_floorplan

How to Contribute?

  1. Git clone this repo.
  2. Install required packages and pre-commit-hooks.
pip install -r requirements.txt
pip install pre-commit
pre-commit install
pre-commit run
pre-commit run --all-files
# pre-commit uninstall/ pip uninstall pre-commit
  1. Create issues. Maintainer will decide if it requires branch. If so,
git fetch origin
git checkout xx-features
  1. Stage your files, Commit and Push to branch.
  2. After pull and merge requests, the issue is solved and the branch is deleted. You can,
git checkout main
git pull
git remote prune origin
git branch -d xx-features

Results

  • From train.py and tensorboard.
Compare Ground Truth (top)
against Outputs (bottom)
Total Loss
Boundary Loss Room Loss
  • From deploy.py and utils/legend.py.
Input Legend Output
--colorize --postprocess --colorize
--postprocess
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].