How to change the output label of a pretrained model.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I have a pretrained model from 'https://ssd.mathworks.com/supportfiles/vision/data/deeplabv3plusResnet18CamVid.zip'.
How could I change the output label from 11 labels, including "Sky, Building, Pole, Road, Pavement, SignSymbol, Tree, Fence, Car, Pedestrain, Bicyclist" into 5 labels, including "Vehicles, Bicycles and motorcycles, Pedestrians, Drivable surface, Others",
while "Vehicles" contains "Car", "Bicycles and motorcycles" contains "Bicyclists", "Pedestrians" contains "Pedestrian", "Drivable surface" contains "Road", "Others" contains "Sky, Building, Pole, Pavement, SignSymbol, Tree, Fence";
0 comentarios
Respuestas (1)
Aritra
el 2 de Feb. de 2023
Hi,
As per my understanding you are trying to change the output label of a pretrained model.
Pretrained models are read only so it’s not possible to change the output class names of a pretrained model directly. However, you can extract the output labels of a pretrained model store it in a table variable and can perform the required modifications. To do so you can take help of the below code snippet:
Network = load('deeplabv3plusResnet18CamVid.mat');
T1 = Network.metrics;
T2 = T1.ClassMetrics;
T2.Row(9) = cellstr("Vehicles");
You can refer to the MATLAB documentation for more details on cellstr:
Ver también
Categorías
Más información sobre C4ISR en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!