Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def example():
- i = 0
- resultlist_key = []
- result_list = list()
- a_list = list()
- b_list = list()
- a_list.append(feature_matrix_ip)# feature_matrix_ip contains features of the query image
- while i < 70:
- b_list.append(feature_matrix_db[i])# feature_matrix_db contains features of img. in DB
- dist = distance.euclidean(a_list,b_list[i])
- result_list.append(dist)
- resultlist_key = OrderedDict(sorted(enumerate(result_list),key=lambda x: x[0])).keys()
- i = i + 1
- res_lst_srt = {'values': result_list,'keys':resultlist_key}
- res_lst_srt['values'], res_lst_srt['keys'] = zip(*sorted(zip(res_lst_srt['values'], res_lst_srt['keys'])))# sorting according to the least distance and the key will not change
- key = res_lst_srt['keys']
- %run "D:/6th sem/Major project/Code/frame.py"
- Exception in Tkinter callback
- Traceback (most recent call last):
- File "C:UsersHPAppDataLocalEnthoughtCanopy32Appappdatacanopy-1.0.3.1262.win-x86liblib-tkTkinter.py", line 1410, in __call__
- return self.func(*args)
- File "D:6th semMajor projectCodeframe.py", line 323, in matching_image
- res_lst_srt['values'], res_lst_srt['keys'] = zip(*sorted(zip(res_lst_srt['values'], res_lst_srt['keys'])))
- ValueError: need more than 0 values to unpack
- >>> foo, bar = []
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- ValueError: need more than 0 values to unpack
- >>> values=[1,2,3]
- >>> keys=['a', 'b', 'c']
- >>> my_dict = dict(zip(keys, values))
- >>> my_dict
- {'a': 1, 'c': 3, 'b': 2}
- >>> a, b = tuple() # or you could write a, b = []
- Traceback (most recent call last):
- File "<pyshell#319>", line 1, in <module>
- a, b = tuple()
- ValueError: need more than 0 values to unpack
- >>>
- zip(*sorted(zip(res_lst_srt['values'], res_lst_srt['keys'])))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement