kushalvyas / bag-of-visual-words-python Goto Github PK
View Code? Open in Web Editor NEWImplementing Bag of Visual words approach for object classification and detection
Home Page: https://kushalvyas.github.io/BOV.html
License: MIT License
Implementing Bag of Visual words approach for object classification and detection
Home Page: https://kushalvyas.github.io/BOV.html
License: MIT License
Always receiving this error when I run the program. Need help
Hi Kushal,
I have a simliar problem (but with a completely different dataset) in my master thesis. (I'm also studying computer science here in Germany) And it would be perfect if I can quote and use some of your code ideas in my own master thesis. So I would ask, if it is possible that you add an licence (just for usage in science) in your repository?
Thank you in advance.
Best Regards,
Pablo
I have read through the blog , still didn't understand why j is not used within kmeans_ret
old_count = 0
for i in range(n_images):
l = len(descriptor_list[i])
for j in range(l):
if kmeans_ret is None:
idx = self.kmeans_ret[old_count+j]
else:
idx = kmeans_ret[old_count+j]
self.mega_histogram[i][idx] += 1
old_count += l
print "Vocabulary Histogram Generated"
I am trying this model on multiclass classification. My trained dataset contains four folders Happy, Sad, Neutral, Angry. The first problem it's reading every image from all folder when it is going to read angry or any other label image and second it's not taking the two labels only angry and sad it's taking not other two.
Can anyone help me with that?
Eagerly waiting for the solution.
Can you please please help to this error
File "Bag.py", line 160, in
bov.trainModel()
File "Bag.py", line 50, in trainModel
bov_descriptor_stack = self.bov_helper.formatND(self.descriptor_list)
File "/home/ram/RAM/From 11-June-2018/1.Image_classification/Bag-of-Visual-Words-Python/helpers.py", line 87, in formatND
vStack = np.vstack((vStack, remaining))
File "/home/ram/anaconda3/envs/pytorch/lib/python2.7/site-packages/numpy/core/shape_base.py", line 234, in vstack
return _nx.concatenate([atleast_2d(_m) for _m in tup], 0)
ValueError: all the input array dimensions except for the concatenation axis must match exactly
Traceback (most recent call last):
File "Bag.py", line 160, in <module>
bov.trainModel()
File "Bag.py", line 50, in trainModel
bov_descriptor_stack = self.bov_helper.formatND(self.descriptor_list)
File "C:\Users\birdman\OneDrive\Project\MY STUFFS\bag of visual word\Bag-of-Visual-Words-Python-master\Bag-of-Visual-Words-Python-master\helpers.py", line 85, in formatND
vStack = np.array(l[0])
IndexError: list index out of range
File "Bag.py", in 140, 141:
parser.add_argument('--train_path', action="store", dest="train_path", required=True)
parser.add_argument('--test_path', action="store", dest="test_path", required=True)
but in the instruction README.md file, it shows:
python Bag.py --train_set images/train/ --test_set images/test/
Need to change 'python Bag.py --train_set images/train/ --test_set images/test/' to 'python Bag.py --train_path images/train/ --test_path images/test/' in README.md to make to work properly.
Thanks.
Hello!
I am a medical engineering student studying in Germany. I am trying to implement a similar problem for my master thesis and this code is almost exactly what I want to do. Is it permissible to use this code? It would be really helpful if you can let me know how I can cite you, the author for this code.
Thank you in advance.
Best Regards,
Gayathri
deleted
你好,我下载了您的代码,但是运行的时候,Bag.py
for word, imlist in self.images.items():
self.name_dict[str(label_count)] = word
print("Computing Features for ", word)
print(imlist)
for im in imlist:
这里由于python3,我改成了items(),但是imlist传进来是个空的,请问这是怎么回事呢?
我很着急,能麻烦您跟我联系一下么?
#line number 139
for each in glob("{}/*".format(path)):
key = each.split("/")[-1]
key = key.split("\\""")[-1]
print(" #### Reading image category ", key, " ##### ")
imlist[key] = []
for imagefile in glob(path+key+"/*.jpg"):
print("Reading file ", imagefile)
im = cv2.imread(imagefile)
imlist[key].append(im)
count +=1
I don't know why but i am getting a lot of deprecated warnings.
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.