final changes

parent 3f4ff138
import numpy as np import numpy as np
import cv2 import cv2
import tensorflow as tf import tensorflow as tf
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-m", "--model", type=str,default="models/model.h5")
cap = cv2.VideoCapture(0) cap = cv2.VideoCapture(0)
args = parser.parse_args()
model = tf.keras.models.load_model("models/model.h5")
model = tf.keras.models.load_model(args.model)
print("Loaded model from disk") print("Loaded model from disk")
sign = { sign = {
......
name: ml725 name: ml725
channels: channels:
- anaconda
- conda-forge - conda-forge
- anaconda
- defaults - defaults
dependencies: dependencies:
- _libgcc_mutex=0.1=main
- _tflow_select=2.3.0=mkl - _tflow_select=2.3.0=mkl
- ca-certificates=2019.10.16=0
- certifi=2019.9.11=py37_0
- gast=0.2.2=py37_0
- google-pasta=0.1.7=py_0
- openssl=1.1.1=h7b6447c_0
- opt_einsum=3.1.0=py_0
- pandas=0.25.2=py37he6710b0_0
- python-dateutil=2.8.0=py37_0
- pytz=2019.3=py_0
- tensorboard=2.0.0=pyhb230dea_0
- tensorflow=2.0.0=mkl_py37h66b46cc_0
- tensorflow-base=2.0.0=mkl_py37h9204916_0
- tensorflow-estimator=2.0.0=pyh2649769_0
- webencodings=0.5.1=py37_1
- wrapt=1.11.2=py37h7b6447c_0
- absl-py=0.8.1=py37_0 - absl-py=0.8.1=py37_0
- astor=0.7.1=py_0 - astor=0.7.1=py_0
- binutils_impl_linux-64=2.31.1=h7fc9f1b_2 - binutils_impl_linux-64=2.31.1=h7fc9f1b_2
- binutils_linux-64=2.31.1=h6176602_12 - binutils_linux-64=2.31.1=h6176602_12
- bzip2=1.0.8=h516909a_1 - bzip2=1.0.8=h516909a_1
- c-ares=1.15.0=h516909a_1001 - c-ares=1.15.0=h516909a_1001
- ca-certificates=2019.10.16=0
- cairo=1.16.0=hfb77d84_1002 - cairo=1.16.0=hfb77d84_1002
- certifi=2019.9.11=py37_0
- dbus=1.13.6=he372182_0 - dbus=1.13.6=he372182_0
- expat=2.2.5=he1b5a44_1004 - expat=2.2.5=he1b5a44_1004
- ffmpeg=4.1.3=h167e202_0 - ffmpeg=4.1.3=h167e202_0
- fontconfig=2.13.1=h86ecdb6_1001 - fontconfig=2.13.1=h86ecdb6_1001
- freetype=2.10.0=he983fc9_1 - freetype=2.10.0=he983fc9_1
- gast=0.2.2=py37_0
- gcc_impl_linux-64=7.3.0=habb00fd_2 - gcc_impl_linux-64=7.3.0=habb00fd_2
- gcc_linux-64=7.3.0=h553295d_12 - gcc_linux-64=7.3.0=h553295d_12
- gettext=0.19.8.1=hc5be6a0_1002 - gettext=0.19.8.1=hc5be6a0_1002
...@@ -39,6 +28,7 @@ dependencies: ...@@ -39,6 +28,7 @@ dependencies:
- glib=2.58.3=h6f030ca_1002 - glib=2.58.3=h6f030ca_1002
- gmp=6.1.2=hf484d3e_1000 - gmp=6.1.2=hf484d3e_1000
- gnutls=3.6.5=hd3a4fd2_1002 - gnutls=3.6.5=hd3a4fd2_1002
- google-pasta=0.1.7=py_0
- graphite2=1.3.13=hf484d3e_1000 - graphite2=1.3.13=hf484d3e_1000
- grpcio=1.23.0=py37he9ae1f9_0 - grpcio=1.23.0=py37he9ae1f9_0
- gst-plugins-base=1.14.5=h0935bb2_0 - gst-plugins-base=1.14.5=h0935bb2_0
...@@ -54,10 +44,15 @@ dependencies: ...@@ -54,10 +44,15 @@ dependencies:
- keras=2.3.1=py37_0 - keras=2.3.1=py37_0
- keras-applications=1.0.8=py_1 - keras-applications=1.0.8=py_1
- keras-preprocessing=1.1.0=py_0 - keras-preprocessing=1.1.0=py_0
- krb5=1.16.1=h173b8e3_7
- lame=3.100=h14c3975_1001 - lame=3.100=h14c3975_1001
- libblas=3.8.0=14_openblas - libblas=3.8.0=14_openblas
- libcblas=3.8.0=14_openblas - libcblas=3.8.0=14_openblas
- libclang=9.0.0=hc9558a2_1 - libclang=9.0.0=hc9558a2_1
- libcurl=7.65.3=h20c2e04_0
- libedit=3.1.20181209=hc058e9b_0
- libffi=3.2.1=hd88cf55_4
- libgcc-ng=9.1.0=hdf63c60_0
- libgfortran-ng=7.3.0=hdf63c60_2 - libgfortran-ng=7.3.0=hdf63c60_2
- libgpuarray=0.7.6=h14c3975_1003 - libgpuarray=0.7.6=h14c3975_1003
- libiconv=1.15=h516909a_1005 - libiconv=1.15=h516909a_1005
...@@ -68,6 +63,7 @@ dependencies: ...@@ -68,6 +63,7 @@ dependencies:
- libpng=1.6.37=hed695b0_0 - libpng=1.6.37=hed695b0_0
- libprotobuf=3.8.0=h8b12597_0 - libprotobuf=3.8.0=h8b12597_0
- libssh2=1.8.2=h22169c7_2 - libssh2=1.8.2=h22169c7_2
- libstdcxx-ng=9.1.0=hdf63c60_0
- libtiff=4.1.0=hfc65ed5_0 - libtiff=4.1.0=hfc65ed5_0
- libuuid=2.32.1=h14c3975_1000 - libuuid=2.32.1=h14c3975_1000
- libwebp=1.0.2=h576950b_1 - libwebp=1.0.2=h576950b_1
...@@ -79,24 +75,43 @@ dependencies: ...@@ -79,24 +75,43 @@ dependencies:
- markdown=3.1.1=py_0 - markdown=3.1.1=py_0
- markupsafe=1.1.1=py37h516909a_0 - markupsafe=1.1.1=py37h516909a_0
- mock=3.0.5=py37_0 - mock=3.0.5=py37_0
- ncurses=6.1=he6710b0_1
- nettle=3.4.1=h1bed415_1002 - nettle=3.4.1=h1bed415_1002
- nspr=4.23=he1b5a44_0 - nspr=4.23=he1b5a44_0
- nss=3.47=he751ad9_0 - nss=3.47=he751ad9_0
- numpy=1.17.3=py37h95a1406_0 - numpy=1.17.3=py37h95a1406_0
- opencv=4.1.1=py37h0cc45ee_2 - opencv=4.1.1=py37h0cc45ee_2
- openh264=1.8.0=hdbcaa40_1000 - openh264=1.8.0=hdbcaa40_1000
- openssl=1.1.1=h7b6447c_0
- opt_einsum=3.1.0=py_0
- pandas=0.25.2=py37he6710b0_0
- pcre=8.43=he1b5a44_0 - pcre=8.43=he1b5a44_0
- pip=19.3.1=py37_0
- pixman=0.38.0=h516909a_1003 - pixman=0.38.0=h516909a_1003
- protobuf=3.8.0=py37he1b5a44_1 - protobuf=3.8.0=py37he1b5a44_1
- pthread-stubs=0.4=h14c3975_1001 - pthread-stubs=0.4=h14c3975_1001
- pygpu=0.7.6=py37hc1659b7_1000 - pygpu=0.7.6=py37hc1659b7_1000
- python=3.7.4=h265db76_1
- python-dateutil=2.8.0=py37_0
- pytz=2019.3=py_0
- pyyaml=5.1.2=py37h516909a_0 - pyyaml=5.1.2=py37h516909a_0
- qt=5.12.5=hd8c4c69_1 - qt=5.12.5=hd8c4c69_1
- readline=7.0=h7b6447c_5
- scipy=1.3.1=py37h921218d_2 - scipy=1.3.1=py37h921218d_2
- setuptools=41.6.0=py37_0
- six=1.13.0=py37_0 - six=1.13.0=py37_0
- sqlite=3.30.1=h7b6447c_0
- tensorboard=2.0.0=pyhb230dea_0
- tensorflow=2.0.0=mkl_py37h66b46cc_0
- tensorflow-base=2.0.0=mkl_py37h9204916_0
- tensorflow-estimator=2.0.0=pyh2649769_0
- termcolor=1.1.0=py_2 - termcolor=1.1.0=py_2
- theano=1.0.4=py37hf484d3e_1000 - theano=1.0.4=py37hf484d3e_1000
- tk=8.6.8=hbc83047_0
- webencodings=0.5.1=py37_1
- werkzeug=0.16.0=py_0 - werkzeug=0.16.0=py_0
- wheel=0.33.6=py37_0
- wrapt=1.11.2=py37h7b6447c_0
- x264=1!152.20180806=h14c3975_0 - x264=1!152.20180806=h14c3975_0
- xorg-kbproto=1.0.7=h14c3975_1002 - xorg-kbproto=1.0.7=h14c3975_1002
- xorg-libice=1.0.10=h516909a_0 - xorg-libice=1.0.10=h516909a_0
...@@ -109,24 +124,13 @@ dependencies: ...@@ -109,24 +124,13 @@ dependencies:
- xorg-renderproto=0.11.1=h14c3975_1002 - xorg-renderproto=0.11.1=h14c3975_1002
- xorg-xextproto=7.3.0=h14c3975_1002 - xorg-xextproto=7.3.0=h14c3975_1002
- xorg-xproto=7.0.31=h14c3975_1007 - xorg-xproto=7.0.31=h14c3975_1007
- yaml=0.1.7=h14c3975_1001
- zstd=1.4.3=h3b9ef0a_0
- _libgcc_mutex=0.1=main
- krb5=1.16.1=h173b8e3_7
- libcurl=7.65.3=h20c2e04_0
- libedit=3.1.20181209=hc058e9b_0
- libffi=3.2.1=hd88cf55_4
- libgcc-ng=9.1.0=hdf63c60_0
- libstdcxx-ng=9.1.0=hdf63c60_0
- ncurses=6.1=he6710b0_1
- pip=19.3.1=py37_0
- python=3.7.4=h265db76_1
- readline=7.0=h7b6447c_5
- setuptools=41.6.0=py37_0
- sqlite=3.30.1=h7b6447c_0
- tk=8.6.8=hbc83047_0
- wheel=0.33.6=py37_0
- xz=5.2.4=h14c3975_4 - xz=5.2.4=h14c3975_4
- yaml=0.1.7=h14c3975_1001
- zlib=1.2.11=h7b6447c_3 - zlib=1.2.11=h7b6447c_3
prefix: /home/shreyansh/.conda/envs/ml725 - zstd=1.4.3=h3b9ef0a_0
- pip:
- joblib==0.14.0
- scikit-learn==0.21.3
- sklearn==0.0
prefix: /home/rht/miniconda3/envs/ml725
import pandas as pd import pandas as pd
import numpy as np import numpy as np
import argparse
import tensorflow as tf import tensorflow as tf
from keras.models import Sequential,load_model from keras.models import Sequential,load_model
from keras.layers import Dense, Conv2D, Flatten, MaxPooling2D, Dropout from keras.layers import Dense, Conv2D, Flatten, MaxPooling2D, Dropout
from sklearn.preprocessing import LabelBinarizer from sklearn.preprocessing import LabelBinarizer
trainData = pd.read_csv("data/sign_mnist_train.csv").values parser = argparse.ArgumentParser()
testData = pd.read_csv("data/sign_mnist_test.csv").values parser.add_argument("-train", "--train_data", type=str,default="data/sign_mnist_train.csv")
parser.add_argument("-test", "--test_data", type=str,default="data/sign_mnist_test.csv")
args = parser.parse_args()
trainData = pd.read_csv(args.train_data).values
testData = pd.read_csv(args.test_data).values
trainX,trainY = trainData[:,1:],LabelBinarizer().fit_transform(trainData[:,0:1]) trainX,trainY = trainData[:,1:],LabelBinarizer().fit_transform(trainData[:,0:1])
testX,testY = testData[:,1:],LabelBinarizer().fit_transform(testData[:,0:1]) testX,testY = testData[:,1:],LabelBinarizer().fit_transform(testData[:,0:1])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment