Comments (5)
Hi @nicejava, could you please elaborate on what you mean by it predicts wrong class by sharing the results you are getting?
from mask-rcnn_tf2.14.0.
Thank for reply
ok i try train 5 class CLASS_NAMES = ['A', 'B', 'C', 'D', 'E']
# Number of classes (including background)
NUM_CLASSES = 1 + 5 # Background + object
And I have image for testing 5 class too like this
01.jpg = class A
02.jpg = class B
03.jpg = class C
04.jpg = class D
05.jpg = class E
So after trained i try testing each image but result display first always is 'A'
No matter where I use it, the results are the same, which is A
such as i try testing 03.jpg which should have received the answer C, but instead received the answer A
r = model.detect([image], verbose=0)
r = r[0]
result r['class_ids'] is 1 every time testing ( [1 1] : [0.97279286 0.9367134 ] )
from mask-rcnn_tf2.14.0.
You would also need to register these class names and assign class_id
in your Dataset
class when training using the add_class function here. Without this, the model will not learn the specific classes during training and would produce random results during inference.
Please follow this tutorial as it gives you a proper walkthrough on how to train mask-rcnn using your own dataset.
from mask-rcnn_tf2.14.0.
I try added class like this, draw mask correct predict shape very good. But label show first always it's incorrect result label
I used mrcnn-prediction.py code for predict
model.detect return 1 always
.. thanks
from mask-rcnn_tf2.14.0.
It's NOT incorrect class labels that your model is returning. In fact, your model is always returning 1
as the class label. I think you are directly copying the BalloonDataset
class which is particularly designed for 1 class. Notice that the load_mask() function is always returning an array of ones (as class IDs) along with the masks.
However, in your case, there are 5 different classes. You'd also need to return particular class indices when returning the masks. You can follow the solution suggested in this issue to fix your problem and retrain the network again.
Particularly, you would need to pass the list of your class_ids
when loading image with add_image()
here and update the return
from load_mask()
with this return mask, info['class_ids']
.
Additionally, you can follow the notebook that illustrates how to train Mask R-CNN on the Shapes dataset which happens to be a multiclass dataset similar to yours. I hope this answers your question.
from mask-rcnn_tf2.14.0.
Related Issues (13)
- 'SGD' object has no attribute 'get_updates' HOT 4
- Nucleus HOT 2
- Error when i try to train the model HOT 1
- SGD optimizer HOT 1
- keras.optimizers.legacy.SGD() not working HOT 1
- Run with GPU HOT 4
- Cannot use GPU training HOT 2
- Getting weird predictions. HOT 4
- Using other optimizers HOT 1
- GOOGLE COLAB PYTHON VERSION HOT 5
- Train Fail HOT 1
- train False HOT 1
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 mask-rcnn_tf2.14.0.