diff --git a/README.md b/README.md index 4b54030..d068c8e 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,34 @@ # Web app to annotate/label images +## Instructions to run +The following pre-requisites need to be satisified for the project to run: +* Python 2.7 +* Django 1.11.2 +* `pip` +* OpenCV +* pip +* Pillow 4.1.1 +* TensorBox +* pkg-config +* virtualenv +* FreeType + +For Ubuntu, the below files are required before installing the required modules: +``` +sudo apt-get install libfreetype6-dev libxft-dev +sudo apt-get install python-tk +``` +Following commands can be used to install pre-reqs using `pip`: +``` + git clone https://github.com/saifrahmed/HiringExercise_MLEngineer_Baljit92.git + cd HiringExercise_MLEngineer_Baljit92 + chmod +x *.sh + ./setup_virtualenv.sh + source ./bin/activate +``` + + ## Description The web app let's the user annotate images by drawing a bounding box around the skulls in the image. The user can label the image with *Skull* or *Not Skull* class. @@ -24,28 +52,8 @@ Once we have the dataset, we manually separate 20% of the data for validation an ## Instructions to run -The following pre-requisites need to be satisified for the project to run: -* Python 2.7 -* Django 1.11.2 -* `pip` -* OpenCV -* pip -* Pillow 4.1.1 - - -For Ubuntu, the below files are required before installing the required modules: -``` -sudo apt-get install libfreetype6-dev libxft-dev -sudo apt-get install python-tk -``` -Following commands can be used to install pre-reqs using `pip`: -``` -git clone https://github.com/saifrahmed/HiringExercise_MLEngineer_Baljit92.git -cd HiringExercise_MLEngineer_Baljit92 -pip install -r requirements.txt -``` -Once installed, follow the commands below: +Once the requirements have been installed, follow the commands below to run the server: ``` cd src/webapp/TrainImage_Annotate/ python manage.py runserver @@ -73,16 +81,6 @@ After downloading the dataset csv file from the webapp; use the script `convert_ Once we have the training data and the validation data, use [TensorBox](https://github.com/TensorBox/TensorBox) to train a machine learning model. A trained model has already been provided with the name of _save.ckpt-18000_ -## Pre-requisites -The following pre-requisites need to be satisified for the machine learning project to run: -* Python 2.7 -* TensorBox -* OpenCV -* pip -* pkg-config -* virtualenv -* Pillow 4.1.1 -* FreeType ## Instructions to run @@ -92,15 +90,8 @@ sudo apt-get install libfreetype6-dev libxft-dev sudo apt-get install python-tk ``` -To setup TensorBox and evaluate the model, follow instructions below: +To setup TensorBox and evaluate the model, follow instructions below(inside virtualenv) after the requirements have been installed: - - git clone https://github.com/saifrahmed/HiringExercise_MLEngineer_Baljit92.git - cd HiringExercise_MLEngineer_Baljit92 - pip install -r requirements.txt - chmod +x *.sh - ./install_tensorflow.sh - source ./bin/activate ./libraries_setup.sh ./install_tensorbox.sh mv ./src/machine_learning/model/* ./tensorbox/data/ diff --git a/install_tensorbox.sh b/install_tensorbox.sh deleted file mode 100755 index 7a522e6..0000000 --- a/install_tensorbox.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -echo "Cloning TensorBox" -git clone http://github.com/russell91/tensorbox -cd tensorbox - -# Setting up tensorbox by downloading required files - -echo "Downloading..." - -mkdir -p data && cd data - -osType=$(uname) - case "$osType" in - "Darwin") - { - curl -O http://russellsstewart.com/s/tensorbox/inception_v1.ckpt - mkdir -p overfeat_rezoom && cd overfeat_rezoom - curl -O http://russellsstewart.com/s/tensorbox/overfeat_rezoom/save.ckpt-150000v2 - } ;; - "Linux") - { - wget --continue http://russellsstewart.com/s/tensorbox/inception_v1.ckpt - mkdir -p overfeat_rezoom && cd overfeat_rezoom - wget --continue http://russellsstewart.com/s/tensorbox/overfeat_rezoom/save.ckpt-150000v2 - } ;; - *) - { - echo "Unsupported OS, exiting" - exit - } ;; - esac -cd .. -pwd -echo "Compiling Tensorflow libraries" -cd ../utils && make && cd .. \ No newline at end of file diff --git a/install_tensorflow.sh b/setup_virtualenv.sh similarity index 89% rename from install_tensorflow.sh rename to setup_virtualenv.sh index e2ab75e..7c408c2 100755 --- a/install_tensorflow.sh +++ b/setup_virtualenv.sh @@ -27,6 +27,3 @@ virtualenv --system-site-packages . echo "Activate the viratualenv" source ./bin/activate - -echo "Installing tensorflow" -pip install --upgrade tensorflow diff --git a/src/machine_learning/data/testing_set_present.json b/src/machine_learning/data/testing_set_present.json new file mode 100644 index 0000000..ac93b3e --- /dev/null +++ b/src/machine_learning/data/testing_set_present.json @@ -0,0 +1 @@ +[{"rects": [], "image_path": "../src/webapp/TrainImage_Annotate/uploadFils/imageTest.jpeg"}] \ No newline at end of file diff --git a/src/webapp/TrainImage_Annotate/Annotate/static/css/style.css b/src/webapp/TrainImage_Annotate/Annotate/static/css/style.css index 3e92bf2..a0cbabb 100644 --- a/src/webapp/TrainImage_Annotate/Annotate/static/css/style.css +++ b/src/webapp/TrainImage_Annotate/Annotate/static/css/style.css @@ -38,4 +38,9 @@ a:hover .button-design { margin-top: 100px; -} \ No newline at end of file +} + +.imgContainer{ + float:left; +} + diff --git a/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/android/drawable-hdpi/ic_cloud_upload_black_48dp.png b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/android/drawable-hdpi/ic_cloud_upload_black_48dp.png new file mode 100644 index 0000000..6506c72 Binary files /dev/null and b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/android/drawable-hdpi/ic_cloud_upload_black_48dp.png differ diff --git a/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/android/drawable-mdpi/ic_cloud_upload_black_48dp.png b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/android/drawable-mdpi/ic_cloud_upload_black_48dp.png new file mode 100644 index 0000000..81155da Binary files /dev/null and b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/android/drawable-mdpi/ic_cloud_upload_black_48dp.png differ diff --git a/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/android/drawable-xhdpi/ic_cloud_upload_black_48dp.png b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/android/drawable-xhdpi/ic_cloud_upload_black_48dp.png new file mode 100644 index 0000000..248289e Binary files /dev/null and b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/android/drawable-xhdpi/ic_cloud_upload_black_48dp.png differ diff --git a/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/android/drawable-xxhdpi/ic_cloud_upload_black_48dp.png b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/android/drawable-xxhdpi/ic_cloud_upload_black_48dp.png new file mode 100644 index 0000000..932af18 Binary files /dev/null and b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/android/drawable-xxhdpi/ic_cloud_upload_black_48dp.png differ diff --git a/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/android/drawable-xxxhdpi/ic_cloud_upload_black_48dp.png b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/android/drawable-xxxhdpi/ic_cloud_upload_black_48dp.png new file mode 100644 index 0000000..33d7523 Binary files /dev/null and b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/android/drawable-xxxhdpi/ic_cloud_upload_black_48dp.png differ diff --git a/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/ios/ic_cloud_upload_48pt.imageset/Contents.json b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/ios/ic_cloud_upload_48pt.imageset/Contents.json new file mode 100644 index 0000000..7c9c016 --- /dev/null +++ b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/ios/ic_cloud_upload_48pt.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images": [ + { + "filename": "ic_cloud_upload_48pt.png", + "idiom": "universal", + "scale": "1x" + }, + { + "filename": "ic_cloud_upload_48pt_2x.png", + "idiom": "universal", + "scale": "2x" + }, + { + "filename": "ic_cloud_upload_48pt_3x.png", + "idiom": "universal", + "scale": "3x" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/ios/ic_cloud_upload_48pt.imageset/ic_cloud_upload_48pt.png b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/ios/ic_cloud_upload_48pt.imageset/ic_cloud_upload_48pt.png new file mode 100644 index 0000000..81155da Binary files /dev/null and b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/ios/ic_cloud_upload_48pt.imageset/ic_cloud_upload_48pt.png differ diff --git a/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/ios/ic_cloud_upload_48pt.imageset/ic_cloud_upload_48pt_2x.png b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/ios/ic_cloud_upload_48pt.imageset/ic_cloud_upload_48pt_2x.png new file mode 100644 index 0000000..248289e Binary files /dev/null and b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/ios/ic_cloud_upload_48pt.imageset/ic_cloud_upload_48pt_2x.png differ diff --git a/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/ios/ic_cloud_upload_48pt.imageset/ic_cloud_upload_48pt_3x.png b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/ios/ic_cloud_upload_48pt.imageset/ic_cloud_upload_48pt_3x.png new file mode 100644 index 0000000..932af18 Binary files /dev/null and b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/ios/ic_cloud_upload_48pt.imageset/ic_cloud_upload_48pt_3x.png differ diff --git a/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/web/cloud-upload.png b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/web/cloud-upload.png new file mode 100644 index 0000000..81155da Binary files /dev/null and b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/web/cloud-upload.png differ diff --git a/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/web/ic_cloud_upload_black_48dp_2x.png b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/web/ic_cloud_upload_black_48dp_2x.png new file mode 100644 index 0000000..248289e Binary files /dev/null and b/src/webapp/TrainImage_Annotate/Annotate/static/img/cloud/web/ic_cloud_upload_black_48dp_2x.png differ diff --git a/src/webapp/TrainImage_Annotate/Annotate/static/img/ring-alt.gif b/src/webapp/TrainImage_Annotate/Annotate/static/img/ring-alt.gif new file mode 100644 index 0000000..e0a56f3 Binary files /dev/null and b/src/webapp/TrainImage_Annotate/Annotate/static/img/ring-alt.gif differ