Comments (4)
You don't need BatchGenerator
to do that. Just pass the video frames to the model's predict()
method.
from ssd_keras.
Thanks for your reply.
I have tried to test an image which is not belong to the validate dataset. Once, I am able to do that then I can pass the video frames into the model.predict(). I have tried as follows,
image_load=Image.open('./examples/bike.jpg')
image_load=np.asarray(image_load, dtype="float32")
test = BatchGenerator(filenames=image_load)
test_class = test.generate(batch_size=1,
train=False,
equalize=False,
brightness=False,
flip=False,
translate=False,
scale=False,
random_crop=False,
crop=False,
resize=False,
gray=False,
limit_boxes=True,
include_thresh=0.4,
diagnostics=False)
X, filenames = next(test_class)
i = 0
#Make a prediction
y_pred = model.predict(X)
The error is "ValueError: Found input variables with inconsistent numbers of samples: [1, 0]".
from ssd_keras.
I've already answered an almost identical question in #28.
Note that
- The
filenames
argument in theBatchGenerator
constructor expects a list that contains the paths to the images, not the images themselves. So it would have to beimage_load=['./examples/bike.jpg']
. - The first point also illustrates why it is unnecessary to use
BatchGenerator
here. You've already loaded the image withImage.open()
, so why would you need to pass it to the batch generator? All you need to do is pass the loaded image tomodel.predict()
. Be aware thatmodel.predict()
wants 4-dimensional input though, even if it is just one image, so ifimg
is your image, the call has to bemodel.predict(np.array([img]))
, notmodel.predict(img)
.
from ssd_keras.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from ssd_keras.
Related Issues (20)
- InvalidArgumentError when compiling model with ssd_loss HOT 1
- WARNING:tensorflow:Gradients do not exist for variables ['conv4_3/bias:0',...] when minimizing the loss. HOT 1
- "Invalid argument: Index out of range using input dim 0; input has only 0 dims" during ssd300 model training
- load weight
- ValueError: Error when checking input: expected input_3 to have 4 dimensions, but got array with shape
- While training I got training terminate error . Epoch 00001: LearningRateScheduler setting learning rate to 0.001. 1/10 [==>...........................] - ETA: 4:08 - loss: nanBatch 0: Invalid loss, terminating training Epoch 00001: saving model to ssd512_URPC2018_epoch-01.h5 Process finished with exit code 0
- ValueError: An operation has `None` for gradient. Please make sure that all of your ops have a gradient defined (i.e. are differentiable). Common ops without gradient: K.argmax, K.round, K.eval.
- ValueError: Layer model expects 1 input(s), but it received 2 input tensors. Inputs received: [<tf.Tensor 'IteratorGetNext:0' shape=(None, None, None, None) dtype=uint8>, <tf.Tensor 'IteratorGetNext:1' shape=(None, None, None) dtype=float32>] HOT 23
- Parameters of the model HOT 1
- Bouding boxes predictions are concentrated in left top corner HOT 1
- Ambiguous dimension while trying to load weights.
- Urgent!! Invalid Loss HOT 4
- What are the requirements to run this code?. HOT 1
- Pascal VOC Training Person Detection
- The device being used is CPU while capturing image from webcam. How do I use my GPU for processing instead?
- Label error during Coco Training HOT 1
- TypeError: Expected any non-tensor type, got a tensor instead.
- Changes make the code work in 2023 HOT 2
- custom SSD300 model
- error while training with custom dataset in COCO format
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ssd_keras.