It looks like you're new here. If you want to get involved, click one of these buttons!Sign In
It looks like you're new here. If you want to get involved, click one of these buttons!
I am a bit stuck here, let's load something simple, my custom caffe model has 2 categories (let's say dog and cat), and I need TinyYolo to load dog so that the second custom net would give me the breed of the dog, same goes with cat. (this is just an guide I am trying to write, please don't tell me the tiny_yolo already have cats and dogs, what if I add marine mammals as 3rd option) . So first I changed line 19 and 20 on stream_ty_gn_threaded.py
After that I am trying to change
First thing I did is changing line 207 and 212, where the array only have 2 items now, ['cat','dog'], [1,1]
But line 228 keeps giving me error
classification_probabilities = \
np.reshape(inference_result[0:980], (grid_size, grid_size, num_classifications))
ValueError: cannot reshape array of size 2 into shape (7,7,2)
Whole code that's causing issue is here, I tried to change grid_size, boxes_per_grid_cell, but none of the combination works, I am not really sure how this part of the code work and how can I load my own custom model?
num_classifications = len(network_classifications) # should be 20 grid_size = 7 # the image is a 7x7 grid. Each box in the grid is 64x64 pixels boxes_per_grid_cell = 2 # the number of boxes returned for each grid cell # grid_size is 7 (grid is 7x7) # num classifications is 20 # boxes per grid cell is 2 all_probabilities = np.zeros((grid_size, grid_size, boxes_per_grid_cell, num_classifications)) # classification_probabilities contains a probability for each classification for # each 64x64 pixel square of the grid. The source image contains # 7x7 of these 64x64 pixel squares and there are 20 possible classifications classification_probabilities = \ np.reshape(inference_result[0:980], (grid_size, grid_size, num_classifications))