mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-12-18 16:20:14 +00:00
Merge pull request #5 from TusharSharma16/master
handwriting recognizer and location tracker
This commit is contained in:
commit
4170a81483
24
Handwriting_Recognizer_DNN_classifier.py
Normal file
24
Handwriting_Recognizer_DNN_classifier.py
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
#Importing Libraries
|
||||||
|
import numpy as np
|
||||||
|
import tensorflow as tf
|
||||||
|
import tensorflow.contrib.learn as learn
|
||||||
|
import tensorflow.contrib.metrics as metrics
|
||||||
|
|
||||||
|
#Importing Dataset
|
||||||
|
mnist = learn.datasets.load_dataset('mnist')
|
||||||
|
|
||||||
|
#Training Datasets
|
||||||
|
data = mnist.train.images
|
||||||
|
labels = np.asarray(mnist.train.labels, dtype=np.int32)
|
||||||
|
test_data = mnist.test.images
|
||||||
|
test_labels = np.asarray(mnist.test.labels, dtype=np.int32)
|
||||||
|
feature_columns = learn.infer_real_valued_columns_from_input(data)
|
||||||
|
|
||||||
|
#Applying Classifiers
|
||||||
|
classifier = learn.DNNClassifier(feature_columns=feature_columns, n_classes=10,hidden_units=[1024,512,256])
|
||||||
|
classifier.fit(data, labels, batch_size=100, steps=1000)
|
||||||
|
|
||||||
|
#Evaluating the Results
|
||||||
|
classifier.evaluate(test_data, test_labels)
|
||||||
|
accuracy_score = classifier.evaluate(test_data, test_labels)["accuracy"]
|
||||||
|
print('Accuracy: {0:f}'.format(accuracy_score))
|
3
location_using_ip_address.py
Normal file
3
location_using_ip_address.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
import geocoder
|
||||||
|
g = geocoder.ipinfo('me')
|
||||||
|
print(g.latlng)
|
5
locator.py
Normal file
5
locator.py
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
import geocoder
|
||||||
|
t=input("enter the location:")
|
||||||
|
g = geocoder.arcgis(t)
|
||||||
|
print(g.latlng)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user