Modifying gstreamer debug level values - debugging

I want to modify the values in the gstreamer GstDebuglevel enumeration (You can find it in gst/gstinfo.h). Will it work if I simply change the enum values in the gstinfo.h or should I have to do any other modification? I want to give lower priority to debug related log dumps. How can I achieve the following.
I want something like this:
typedef enum {
GST_LEVEL_NONE = 0,
GST_LEVEL_ERROR = 1,
GST_LEVEL_WARNING = 2,
GST_LEVEL_FIXME = 3,
GST_LEVEL_INFO = 4,
GST_LEVEL_LOG = 6,
GST_LEVEL_TRACE = 7,
/* add more */
GST_LEVEL_MEMDUMP = 9,
/* add more */
GST_LEVEL_DEBUG = 10,
GST_LEVEL_COUNT
}GstDebugLevel;
Thanks in advance.

Changing the enum value and rebuilding gstreamer is enough.
I tested it with this enum:
typedef enum {
GST_LEVEL_NONE = 0,
GST_LEVEL_ERROR,
GST_LEVEL_WARNING,
GST_LEVEL_INFO,
GST_LEVEL_DEBUG=10,
GST_LEVEL_LOG=5,
GST_LEVEL_FIXME = 6,
GST_LEVEL_TRACE = 7,
/* add more */
GST_LEVEL_MEMDUMP = 9,
/* add more */
GST_LEVEL_COUNT
} GstDebugLevel;
And it did not output DEBUG level traces on the same GST_DEBUG value.

Related

Am getting error trying to predict on a single image CNN pytorch

Error message
Traceback (most recent call last):
File "pred.py", line 134, in
output = model(data)
Runtime Error: Expected 4-dimensional input for 4-dimensional weight [16, 3, 3, 3], but got 3-dimensional input of size [1, 32, 32] instead.
Prediction code
normalize = transforms.Normalize(mean=[0.4914, 0.4824, 0.4467],
std=[0.2471, 0.2435, 0.2616])
train_set = transforms.Compose([
transforms.RandomCrop(32, padding=4),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
normalize,
])
model = models.condensenet(args)
model = nn.DataParallel(model)
PATH = "results/savedir/save_models/checkpoint_001.pth.tar"
model.load_state_dict(torch.load(PATH)['state_dict'])
device = torch.device("cpu")
model.eval()
image = Image.open("horse.jpg")
input = train_set(image)
train_loader = torch.utils.data.DataLoader(
input,
batch_size=1,shuffle=True, num_workers=1)
for i, data in enumerate(train_loader):
#input_var = torch.autograd.Variable(data, volatile=True)
#input_var = input_var.view(1, 3, 32,32)
**output = model(data)
topk=(1,5)
maxk = max(topk)
_, pred = output.topk(maxk, 1, True, True)
Am getting this error when am trying to predict on a single image
Image shape/size error message
Link to saved model
Training code repository
Plz uncomment this line #input_var = input_var.view(1, 3, 32,32) so that your input dimension is 4.
I assume that your no. of input channels are 3 if its one then use input_var = input_var.view(1, 1, 32,32) if gray scale
Instead of doing the for loop and train_loader, solved this by just passing the input directly into the model. like this
input = train_set(image)
input = input.unsqueeze(0)
model.eval()
output = model(input)
More details can be found here link

Problem with combobox, it didn't load de options (pyqt5)

I have a program that when I press a pushbutton it loads the options of my combombox, I have three, but for a unknown reason only two works. This function read a .txt file, and then put the strings in the combobox. I tried with addItem() and addItems(), made function again and it didn't work. The function read another two combobox and then loads the options.This is the function:
def cargar_combobox_flujos2(self,event):
anho = int(self.ui.combobox_anho.itemText(self.ui.combobox_anho.currentIndex()))
mes_input = self.ui.combobox_mes.itemText(self.ui.combobox_mes.currentIndex())
dic = {'Enero': 1, 'Febrero': 2, 'Marzo': 3, 'Abril': 4, 'Junio': 5, 'Julio': 7, 'Agosto': 8, 'Septiembre': 9,
'Octubre': 10, 'Noviembre': 11, 'Diciembre': 12}
mes = int(dic.get(mes_input))
lista_ssee=[]
nombre_txt='Graficos Flujos/lista_cbbx_'+str(anho)+'_'+str(mes)+'.txt'
if os.path.isfile(nombre_txt)==True:
archivo = open(nombre_txt, 'r')
c=archivo.read()
lista=c.split(',')
for i in lista:
lista_ssee.append(i)
archivo.close()
option_barras= self.ui.comboBox_barras_CMg2.count()
if option_barras > 1:
self.ui.comboBox_barras_CMg2.clear()
for barra in lista_ssee:
self.ui.comboBox_barras_CMg2.addItems(barra)

Printer OKI trap signification (OID)

Someone of you know how find the signification of trap for an OKI printer (B512) ?
I check the manual, and I search on google but I found anything.
Thank you !
Here is what I could find to interpret the return of the printer status in SNMP :
okiPrinterOnline = 1,
okiPrinterOffline = 2,
okiNoPrinterAttached = 3,
okiPrinterTonerLow = 4,
okiPrinterPaperOut = 5,
okiPrinterPaperJam = 6,
okiPrinterDoorOpen = 7,
okiPrinterError = 16,

vulkan pipeline layout compatibility

Two pipeline layouts are defined to be “compatible for push constants” if they were created with identical push constant ranges. Two pipeline layouts are defined to be “compatible for set N” if they were created with identically defined descriptor set layouts for sets zero through N, and if they were created with identical push constant ranges.
vkCmdBindDescriptorSets causes the sets numbered [firstSet.. firstSet+descriptorSetCount-1] to use the bindings stored in pDescriptorSets[0..descriptorSetCount-1] for subsequent rendering commands (either compute or graphics, according to the pipelineBindPoint). Any bindings that were previously applied via these sets are no longer valid.
suppose there are two pipeline layout, first pipeline layout contain one set #0, second pipeline layout contain two set #0 #1。First set 0 and second set 0 are identical descriptor set layout。also they have same push constant ranges,Therefore as distribution above, both pipeline layout’s set #0 are compatible?
// create set 0
...
VkDescriptorSetLayout setLayout0;
...
vkCreateDescriptorSetLayout(logicalDevice,
&layoutInfo,
nullptr,
&setLayout0);
...
VkDescriptorSet set0;
VkDescriptorSetAllocateInfo allocInfo0 = {};
allocInfo0.descriptorSetCount = 1;
allocInfo0.pSetLayouts = &setLayout0;
...
vkAllocateDescriptorSets(logicalDevice,
&allocInfo0,
&set0);
...
// create first pipeline layout
VkPipelineLayoutCreateInfo firstPipelineLayoutInfo = {};
firstPipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
firstPipelineLayoutInfo.setLayoutCount = 1;
firstPipelineLayoutInfo.pSetLayouts = &setLayout0; // <--- use set0
VkPipelineLayout firstPiplineLayout;
vkCreatePipelineLayout(logicalDevice,
&firstPipelineLayoutInfo,
nullptr,
&firstPiplineLayout);
// create set 1
...
VkDescriptorSetLayout setLayout1;
...
vkCreateDescriptorSetLayout(logicalDevice,
&layoutInfo,
nullptr,
&setLayout1);
...
VkDescriptorSet set1;
VkDescriptorSetAllocateInfo allocInfo1 = {};
allocInfo1.descriptorSetCount = 1;
allocInfo1.pSetLayouts = &setLayout1;
...
vkAllocateDescriptorSets(logicalDevice,
&allocInfo1,
&set1);
...
// create second pipeline layout
array<VkDescriptorSetLayout, 2> setLayout0And1 = {setLayout0, setLayout1} // <---use set0 set1
VkPipelineLayoutCreateInfo secondPipelineLayoutInfo = {};
secondPipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
secondPipelineLayoutInfo.setLayoutCount = 2;
secondPipelineLayoutInfo.pSetLayouts = &setLayout0And1;
VkPipelineLayout secondPiplineLayout;
vkCreatePipelineLayout(logicDevice,
&secondPipelineLayoutInfo,
nullptr,
&secondPiplineLayout);
// create pipeline
VkGraphicsPipelineCreateInfo pipelineInfo = {};
...
pipelineInfo.layout = secondPiplineLayout;
VkPipeline pipeline;
vkCreateGraphicsPipelines(logicDevice,
VK_NULL_HANDLE,
1,
&pipelineInfo,
nullptr,
&pipeline);
After that, call vkCmdBindDescriptorSets to bind when draw.
...
vkCmdBindDescriptorSets(commandBuffer,
VK_PIPELINE_BIND_POINT_GRAPHICS,
firstPiplineLayout,
0,
1,
&set0,
0,
nullptr);
// When call vkCmdBindDescriptorSets with first set > 0 then the bound descriptor sets index [0 ... firstSet-1] will remain the same.
vkCmdBindDescriptorSets(commandBuffer,
VK_PIPELINE_BIND_POINT_GRAPHICS,
secondPiplineLayout,
1,
1,
&set1,
0,
nullptr);
vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
...
vkCmdDrawIndexed(commandBuffer,
indicesCount,
1, 0, 0, 0);
...
After that
validation layer: VkPipeline 0x42 uses set #0 but that set is not bound.
Why is there an error? Where did I get it wrong?

Getting max and min from two different sets in json

I haven't found a solution with data set up quite like mine...
var marketshare = [
{"store": "store1", "share": "5.3%", "q1count": 2, "q2count": 4, "q3count": 0},
{"store": "store2","share": "1.9%", "q1count": 5, "q2count": 10, "q3count": 0},
{"store": "store3", "share": "2.5%", "q1count": 3, "q2count": 6, "q3count": 0}
];
Code so far, returning undefined...
var minDataPoint = d3.min( d3.values(marketshare.q1count) ); //Expecting 2 from store 1
var maxDataPoint = d3.max( d3.values(marketshare.q2count) ); //Expecting 10 from store 2
I'm a little overwhelmed by d3.keys, d3.values, d3.maps, converting to array, etc. Any explanations or nudges would be appreciated.
I think you're looking for something like this instead:
d3.min(marketshare, function(d){ return d.q1count; }) // => 2.
You can pass an accessor function as the second argument to d3.min/d3.max.

Resources