humphd / have-fun-with-machine-learning Goto Github PK
View Code? Open in Web Editor NEWAn absolute beginner's guide to Machine Learning and Image Classification with Neural Networks
License: Other
An absolute beginner's guide to Machine Learning and Image Classification with Neural Networks
License: Other
Hi there,
I have cloned the repository to GitHub desktop and run the following command with the /path/to/this/repository replaced with my local directory of the repository.
docker run --name digits -d -p 8080:5000 -v /path/to/this/repository:/data/repo kaixhin/digits
My container exits immediately upon creation as seen when typing docker ps -a. Am I doing something wrong?
Thanks
原句
docker run --name digits -d -p 8080:5000 -v $(pwd)/have-fun-with-machine-learning:/data/repo /kaixhin/digits
是不是应该把kaixhin前的“/”去掉,改为
docker run --name digits -d -p 8080:5000 -v $(pwd)/have-fun-with-machine-learning:/data/repo kaixhin/digits
Hello, thank you for your work!
Can I translate it into Korean?
Hello,
Consider we have some apples and we want to classify them. apples could differ in shape, size or sign of bruise on them.
Does deep learning classification could be able to distinguish these if we provide the related images for each class?, I mean something like this:
class-1: big apple
class-2: small apple
class-3: bad apple
class-4: good apple
Besides, consider we have an image which consists of three apples. Left, middle and right. how can I make the classifier to provide the classification results for these three apples as for example: left: good apple , middle: bad apple , right: big apple
Hello,
I like your language. it is written straightforward and easy to understand. actually that's an art if somebody has this ability. nice.
as you know GPUs are expensive, therefore do you know how we can train our model on a remote server with GPU cards (such as amazon) which we can rent hourly with low prices or similar?
Hello,
I decided to buy a GTX 1060 or GTX 1070 card to try with Deep Learning, but I am curious if the RAM size of The GPU or its bandwidth/speed will affect the accuracy of the final model or not, by comparing these two specific GPU cards.
in the other word, I want to know selecting the GTX 1060 will just cause longer training time over GTX 1070, or it will affect the accuracy of the model either.
Hello,
I followed everything and installed Caffe and Digits, but my Digits GUI is a bit different with yours. I mean there is no "Pretrained Models" and "processing" tab, and "segmentation" do not show up within drop-down list.
Why it should be like this?!
I've moved from Caffe/Digits to TensorFlow in my own work, and I want to update this to show how to do the same tasks with TensorFlow.
Given the hard work by @BirkhoffLee translating the original, I don't want to break what we already have. I'm debating whether to integrate it into the current document, or start a new one. I think it's nice to see how transferable the approach is across ML frameworks and technologies, so doing it in the same doc might make sense.
Thoughts?
Hi humphd,
Present i am trying to install Caffe and DIGITS using Dockers by following your steps.
I downloaded the Docker.
When i run this query on terminal
--> docker run --name digits -d -p 8080:5000 -v /path/to/this/repository:/data/repo kaixhin/digits
after all downloads i am getting error at last is -->
docker: Error response from daemon: Mounts denied:
The path path/to/this/repository is not shared from os x and is not known to docker.
Can you please tell me how to fix this.
Thank you.
Hey there. Thanks for the tutorial. Can I fork this repository and make a Chinese version of this? I really love this.
Here is my code
import numpy as np
import sys
import os
caffe_root = '/opt/caffe/'
sys.path.insert(0, os.path.join(caffe_root, 'python'))
import caffe
from caffe.proto import caffe_pb2
caffe.set_mode_gpu()
model_dir = 'model'
deploy_file = os.path.join(model_dir, 'deploy.prototxt')
weights_file = os.path.join(model_dir, 'snapshot_iter_64980.caffemodel')
net = caffe.Net(deploy_file, caffe.TEST, weights=weights_file)
transformer = caffe.io.Transformer({'data': net.blobs['data'].data.shape})
transformer.set_transpose('data', (2, 0, 1))
transformer.set_raw_scale('data', 255)
transformer.set_channel_swap('data', (2, 1, 0))
mean_file = os.path.join(model_dir, 'mean.binaryproto')
with open(mean_file, 'rb') as infile:
blob = caffe_pb2.BlobProto()
blob.MergeFromString(infile.read())
if blob.HasField('shape'):
blob_dims = blob.shape
assert len(blob_dims) == 4, 'Shape should have 4 dimensions - shape is %s' % blob.shape
elif blob.HasField('num') and blob.HasField('channels') and
blob.HasField('height') and blob.HasField('width'):
blob_dims = (blob.num, blob.channels, blob.height, blob.width)
else:
raise ValueError('blob does not provide shape or 4d dimensions')
pixel = np.reshape(blob.data, blob_dims[1:]).mean(1).mean(1)
transformer.set_mean('data', pixel)
labels_file = os.path.join(model_dir, 'labels.txt')
labels = np.loadtxt(labels_file, str, delimiter='\n')
image = caffe.io.load_image('test_img.jpg')
net.blobs['data'].data[...] = transformer.preprocess('data', image)
out = net.forward()
softmax_layer = out['softmax']
LLPM_prob = softmax_layer.item(0)
OK_prob = softmax_layer.item(1)
YSBD_prob = softmax_layer.item(2)
YSCQ_prob = softmax_layer.item(3)
print(LLPM_prob)
print(OK_prob)
print(YSBD_prob)
print(YSCQ_prob)
`
4.98672634421e-05
0.00573868537322
0.993777871132
0.000433590757893
Hello,
How did you noticed that which layers should be renamed in GoogLeNet prototxt?
I want to fine-tune the DetectNet but I don't know which layers should be renamed. The sample of object detection with Digits did not publish such part (they have not renamed anything).
Detectnet is not that much different with GoogLeNet so the fine tuning should not be that much different. I like your fine tuning because the classification model worked quite nice and accurately with even low number of images.
Hello,
First I should appreciate your tutorial.
My question is if we decided to detect objects in photos (draw rectangle on detected objects and get the coordinate of the center) what we should do?
and second, ho we can have video as input from the camera? (such as HDMi camera)
Hi,
I'm using the docker option and it's really to setup. However, it's not using all the CPU the resources when training the model. It only use up to 100% cpu, which I believe is 1 core. But I gave the docker 12 cores.
Does any one know how to let it use more resource so it can run faster? Thanks
Hello,David Humphrey.
There are some question about the framework of image classification . You installed the OPNECL caffe. And you finished the image classification based on the Mac pro. You used the Inel graphics. But,the DIGITS cloud be installed if you would use a nvida GPU.
My laptop based on the AMD graphics , and i plan to run this work on VM(Ubuntu 16.04), It means that i can not install and use DIGITS ?
Thanks for reading.
root@8f88fbfbe029:/data/repo/test# python classify-samples.py -c /root/caffe/ -m epoch_30/ -d untrained-samples/
Traceback (most recent call last):
File "classify-samples.py", line 113, in
main()
File "classify-samples.py", line 95, in main
classifier = ImageClassifier(model_dir)
File "classify-samples.py", line 13, in init
self.net = caffe.Net(deploy_file, caffe.TEST, weights=weights_file)
Boost.Python.ArgumentError: Python argument types in
Net.init(Net, str, int)
did not match C++ signature:
init(boost::python::api::object, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, int)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.