Skip to content
This repository has been archived by the owner on Jun 2, 2020. It is now read-only.

Commit

Permalink
Add all notebook and image from desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
minsuk-sung committed Nov 14, 2019
1 parent efed1be commit b0a1840
Show file tree
Hide file tree
Showing 47 changed files with 12,567 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Folders
bin
data
models

# Files
nohup.out

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
824 changes: 824 additions & 0 deletions Image Classification using MobileNet - 01.Theory.ipynb

Large diffs are not rendered by default.

1,304 changes: 1,304 additions & 0 deletions Image Classification using MobileNet - 02. MNIST.ipynb

Large diffs are not rendered by default.

1,185 changes: 1,185 additions & 0 deletions Image Classification using MobileNet - 03. Fashion MNIST.ipynb

Large diffs are not rendered by default.

1,388 changes: 1,388 additions & 0 deletions Image Classification using MobileNet - 04. CIFAR10.ipynb

Large diffs are not rendered by default.

1,597 changes: 1,597 additions & 0 deletions Image Classification using MobileNet - 05. Cat and Dog.ipynb

Large diffs are not rendered by default.

1,493 changes: 1,493 additions & 0 deletions Image Classification using MobileNet - 06. CIFAR100.ipynb

Large diffs are not rendered by default.

1,479 changes: 1,479 additions & 0 deletions Image Classification using MobileNet - 07. Intel Scene Image.ipynb

Large diffs are not rendered by default.

1,946 changes: 1,946 additions & 0 deletions Image Classification using MobileNet - 08. VOC2012.ipynb

Large diffs are not rendered by default.

799 changes: 799 additions & 0 deletions Image Classification using MobileNet - 09. Personal Label.ipynb

Large diffs are not rendered by default.

385 changes: 385 additions & 0 deletions Image Classification using MobileNet - 10. Covert to Caffe.ipynb

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import os
import sys
import warnings

warnings.filterwarnings('ignore')

import cv2
import pickle
import numpy as np
from tensorflow.keras.models import load_model

TEXT_LOC = (30,30)
FONT_SIZE = 0.8

THESHOLD = 0.3

capture = cv2.VideoCapture(0)
capture.set(cv2.CAP_PROP_FRAME_WIDTH,640)
capture.set(cv2.CAP_PROP_FRAME_HEIGHT,480)

model = load_model('./bin/mobilenetv2_class20.h5')

with open('./bin/class20.pickle','rb') as f:
class20 = pickle.load(f)

(major_ver,minor_ver,subminor_ver) = cv2.__version__.split('.')

while True:
ret, frame = capture.read()

if int(major_ver) < 3:
fps = capture.get(cv2.cv.CV_CAP_PROP_FPS)
else:
fps = capture.get(cv2.CAP_PROP_FPS)



img = cv2.resize(frame,(224,224),fx=0.5,fy=0.5,interpolation=cv2.INTER_AREA)
img = cv2.cvtColor(img,cv2.COLOR_BGR2RGB)
img = img / 255

expanded_img = np.expand_dims(img,axis=0)

pred = model.predict(expanded_img)

_cls = class20[np.argmax(pred)]
_prob = np.max(pred)

font_color = (0,0,0)
label = 'Prediction : ...'

if _prob > THESHOLD:

font_color = (0,0,255)
label = 'Prediction : {} ({:.2f}%)'.format(_cls.upper(),_prob * 100)

cv2.putText(frame,label,TEXT_LOC,cv2.FONT_HERSHEY_SIMPLEX,FONT_SIZE,font_color,2)
cv2.putText(frame,'{} FRAMES'.format(fps),(450,30),cv2.FONT_HERSHEY_SIMPLEX,FONT_SIZE,(0,0,0),2)

cv2.imshow('test',frame)

if cv2.waitKey(1) == ord('q'):
break

capture.release()
cv2.destroyAllWindows()
Binary file added img/model/cat_dog_cnn_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/model/cat_dog_vgg16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/model/cifar100_resnet_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/model/cifar10_deeper_cnn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/model/cifar10_resnet_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/model/cifar10_vgg16_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/model/fashion_mnist_cnn_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/model/mnist_cnn_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/result/cifar10_wrong_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/result/fashion_mnist_wrong_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/result/intel_classification_wrong_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/result/mnist_wrong_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/test/aeroplane.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/test/boat.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/test/cat.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/test/dog.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/test/person.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/test/person_bike.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/test/sofa.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/theory/Bottleneck Residual Block.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/theory/STEP1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/theory/STEP2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/theory/depthwise_conv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/theory/dl-trend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/theory/efficiency.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/theory/expansion.jpeg
Binary file added img/theory/intel_logo.png
Binary file added img/theory/mobilenetv2.png
Binary file added img/theory/mobilnetpipeline.png
Binary file added img/theory/residual_inverted.png
Binary file added img/theory/rgb_image.png
Binary file added img/theory/standard_conv.png
Binary file added model.png
93 changes: 93 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
absl-py==0.8.0
astor==0.8.0
attrs==19.2.0
autopep8==1.4.4
backcall==0.1.0
bleach==3.1.0
certifi==2019.9.11
cycler==0.10.0
decorator==4.4.0
defusedxml==0.6.0
entrypoints==0.3
freeze==1.0.10
gast==0.3.2
google-images-download==2.8.0
google-pasta==0.1.7
graphviz==0.13
grpcio==1.16.1
h5py==2.10.0
imutils==0.5.3
ipykernel==5.1.2
ipython==7.8.0
ipython-genutils==0.2.0
jedi==0.15.1
Jinja2==2.10.3
joblib==0.14.0
jsonschema==3.0.2
jupyter-client==5.3.4
jupyter-contrib-core==0.3.3
jupyter-contrib-nbextensions==0.5.1
jupyter-core==4.6.0
jupyter-highlight-selected-word==0.2.0
jupyter-latex-envs==1.4.4
jupyter-nbextensions-configurator==0.4.1
Keras==2.2.4
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0
kiwisolver==1.1.0
lxml==4.4.1
Markdown==3.1.1
MarkupSafe==1.1.1
matplotlib==3.1.1
mistune==0.8.4
mkl-fft==1.0.14
mkl-random==1.1.0
mkl-service==2.3.0
nb-conda==2.2.1
nb-conda-kernels==2.2.2
nbconvert==5.6.0
nbformat==4.4.0
notebook==6.0.1
numpy==1.17.2
olefile==0.46
pandas==0.25.1
pandocfilters==1.4.2
parso==0.5.1
pexpect==4.7.0
pickleshare==0.7.5
Pillow==6.2.0
prometheus-client==0.7.1
prompt-toolkit==2.0.10
protobuf==3.10.0
ptyprocess==0.6.0
pycodestyle==2.5.0
pydot==1.4.1
Pygments==2.4.2
pyparsing==2.4.2
pyrsistent==0.15.4
python-dateutil==2.8.0
pytube==9.5.2
pytz==2019.3
PyYAML==5.1.2
pyzmq==18.1.0
scikit-learn==0.21.3
scipy==1.3.1
seaborn==0.9.0
selenium==3.141.0
Send2Trash==1.5.0
six==1.12.0
tensorboard==1.14.0
tensorflow==1.14.0
tensorflow-estimator==1.14.0
termcolor==1.1.0
terminado==0.8.2
testpath==0.4.2
tornado==6.0.3
tqdm==4.36.1
traitlets==4.3.3
urllib3==1.25.6
wcwidth==0.1.7
webencodings==0.5.1
Werkzeug==0.16.0
wrapt==1.11.2
youtube-dl==2019.10.16

0 comments on commit b0a1840

Please sign in to comment.