Comments (4)
I had the same error. I think is because the pred_blobs
are of shape [num_classes, img_width, img_height]
and the ´image_raw´ is of shape [img_width, img_height, 3]
so there is a shape mismatch.
What I did was: pred_blobs_max = np.argmax(pred_blobs, axis=0)
and the replace pred_blobs
with pred_blobs_max
in the imsave
line.
However my predictions are very bad I am not sure if I made a mistake here or somewhere else.
Does this solution work for you?
from lcfcn.
Thank you very much,
I fixed and no longer have this error, but the result is exactly what you said (it is very bad) and predict_count is always equal to 0 although blobs has appeared on the image.
.
from lcfcn.
@ThanhNguyenFG @sirtris
I have also come accross the problem, according to your method, I fixed my problem, but the result is so strange, my predict_count is normal but the coordinates is on the top of images
from lcfcn.
@ThanhNguyenFG @sirtris @tongpinmo I have found out the problem with this code. In the file applyOnImage.py you can see the line "pred_counts = int(model.predict(batch, method="counts").ravel()[0])"
But actually, it should become pre_counts= model.predict(batch, method="counts").ravel()
Then, you can add "print(pre_counts)" right after that line and then when we run the file main.py , the result of "print(pre_counts)" would be an array of 20 numbers, they are the number of objects for each class in 20 classes:
"aeroplane":0,
"bicycle":1,
"bird":2,
"boat":3,
"bottle":4,
"bus":5,
"car":6,
"cat":7,
"chair":8,
"cow":9,
"diningtable":10,
"dog":11,
"horse":12,
"motorbike":13,
"person":14,
"pottedplant":15,
"sheep":16,
"sofa":17,
"train":18,
"tvmonitor":19
In the code, author just count the number of object of the first class, "aeroplane".
Next, when we use pred_blob_max as @sirtris , then it would create the density map for the class with highest number of object.
from lcfcn.
Related Issues (20)
- Reproducing results in paper
- Inference problem HOT 3
- The prediction was incorrect where use best_model_trancos_ResFCN.pth HOT 1
- How to annotate fro custom data training? HOT 4
- Where are the path_model and path_opt files when training from scratch? HOT 8
- Error in losses.py HOT 2
- ValueError: exp_list is empty... HOT 8
- Can you kindly provide the scripts for testing and visualization of blobs? HOT 2
- Error in loading .pth HOT 2
- Can you provide a model that you trained on trancos data?
- Display results HOT 1
- Wrong output with other backbone networks HOT 4
- How to use the multiclass version?How to organize the dataset?Pascal VOC for example... HOT 1
- How to create files for folder images?
- Inference script HOT 2
- Batch-aware loss function? HOT 3
- How to plot loss during the training ?
- Dear author, can you give me a test.py HOT 1
- sorry,I am a green hand HOT 1
- ERROR: Command errored out with exit status 128 HOT 4
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 lcfcn.