Open wlhpange opened 1 year ago
In addition, this is the code I used.
from mmdet.apis import init_detector, inference_detector, show_result_pyplot
import mmcv
# Load model
config_file = 'CascadeTabNet/Config/cascade_mask_rcnn_hrnetv2p_w32_20e_v2.py'
checkpoint_file = 'epoch_36.pth'
model = init_detector(config_file, checkpoint_file, device='cuda:0')
# Test a single image
img = "CascadeTabNet/Demo/demo.png"
# Run Inference
result = inference_detector(model, img)
# Visualization results
show_result_pyplot(model,img, result,score_thr=0.85)
Do I need to retrain the data set in this environment? But the previous pre-training model can't be used!
Hello, I have encountered the same problem as you. Have you solved it now?
Hello, dear developers. I have a pressing problem now.I am a beginner in this field, and I have the following problems when running demo: The following are tips:
The displayed result is the original image.
After querying the data and browsing the code of the display result function, I found that the show_result_pyplot() function in MMDetection 1.2.0/MMDET/APIs/Influence.py used in master has a class_names parameter, but the mmdetection2.12.0 I used does not have this parameter. I don't know what to do next to make the demo display the correct result. It may not be just the problem of this function, but the pre-training model uses the specified epoch_36.pth. .. I hope you can take the time to guide me.
The following is my configuration environment: PC:windows11 mmdetection:v2.12.0 mmvc:1.4.0 torch:1.5.0 torchvision==0.6.0 cuda:10.1 pillow:9.4.0