So I've been experimenting with CNNs on iOS using the new iOS 10 APIs, and I'm not sure why I'm getting the following results.
So I initialize a plain MPSCNNConvolution class with a weight array of 1.0 and a bias array of 0.0, and kernel width and height of 3. For testing I'm using only a single feature channel. I'm setting the MPSImageEdgeMode to
convolution.edgeMode = .clamp
which, according to the iOS Docs should do the following
Out-of-bound pixels are clamped to the nearest edge pixel.
However, forwarding a texture filled with 1.0s, I get the following result:
4 6 4
6 9 6
4 6 4
which is exactly the same as leaving the edgeMode parameter to its default value .zero - so apparently for the top-left corner (0/0), only the values (0/0), (1/0), (1/1) and (0/1) are considered, and the remaining 5 out-of-bounds values are zero rather then the clamped 1 I expected.
Shouldn't the .clamp parameter result in the following?
9 9 9
9 9 9
9 9 9
Is the expected behaviour, or is there something I'm not considering here?
Thanks!
Related
In my data, I have hundreds of values for the x-axis, but I want to show only 6 or 7 of them at equal intervals so that my whole range of x-axis values are covered, but I am facing an issue as I am not able to show a limited number of values on the x-axis . I tried these
lineChartView.xAxis.spaceMin = 4
lineChartView.xAxis.spaceMax = 7
lineChartView.xAxis.xOffset = 6
lineChartView.xAxis.labelCount = 6
, but it is not working .Here is my screenshot for the display
The axis property granularity is used to specify the minimum interval between axis values. The default value is 1. Currently in my app i have it set to 0.5 to force all values to be displayed, but I only have 10 or so on the chart at once.
chartView.xAxis.granularity = 0.5
Perhaps setting this to a higher value will help you.
I'm using ios-charts Charts to draw a line chart. I'd like to draw a point every 10 min for a 24h period but my x-axis labels needs to show labels every 4 hours like: 12AM 4 8 12PM 4 8. The problem I run into is Charts complaining that the number of data points does not match the number of x-axes values.
What's the best way do do this type of chart? It can't be that hard. Maybe I just learn to love the warning?
make sure you add enough X values to conform the amount of Y values
use [xAxis setLabelsToSkip:23] (24 xAxis values for 10 min delta in 4 hours)
swift definition: public func setLabelsToSkip(count: Int)
Objective-C: - (void)setLabelsToSkip:(NSInteger)count
We currently are looking for some help in getting solid range lines to appear longitudinally on our charts.
For example: Test A has a range of 0 (Very low), 3 (Moderately low), 5 (Low), 5 to 7 (Normal), 7+ (High), 9+ (Moderately high), and 11+ (Very high).
We're looking for a Red line in the Very high condition, Orange in Moderately high, and Yellow for high. Between the normal range we're looking for a Green line at the upper and lower boundary (between 5 and 7).
I don't have any code to show, but I wanted to make sure that Highcharts was even capable of this. I've attached an image of what I'm looking for. If it is possible and you have an example of some code, please let me know.
I set up a group in my WatchApp Storyboard which has a width relative to container 1 and height relative to container 0.5.
Inside this group I have 20 horizontal aligned groups with a width relative to container 0,05. The spacing of the group is set to 0 but when i set a background color to all groups I end up like this.
As you can see, some spacings are really zero but sometimes there is a small gap of about 1 px. Is this some sort of bug? Is it possibile to perfectly align the groups so that it looks like it is one solid background?
Please don't tell me, that I can set the background color of the first group. Obviously I know that, i need it to work like this!
Thanks!
I believe the problem is that the width of the screen isn't evenly divisible by 20. The width of the 42mm screen is 312 pixels, which divided by 20 is 15.6 pixels. Apple is probably truncating this to an integer value for performance, which results in the gaps.
I reproduced your problem and then, to test my theory, I created 8 groups instead of 20 and set them to a width of 0.125. This resulted in no gaps, which makes sense since 312 is divisible by 8.
The 32mm watch has a width of 272 pixels and, doing factorization of the two I got:
272 = 2 * 2 * 2 * 2 * 17
312 = 2 * 2 * 2 * 3 * 13
Which shows that eight columns is the maximum by which you can evenly divide both sizes.
If you have to have 20 columns, then I would set each to a fixed width, some at 15 and some at 16 pixels for the 42 mm, and 13/14 pixels for the 32 mm to get the layout you want.
in opencv frontalface cascade .xml file what are tree node threshold and left value
such as
3 7 14 4 -1. rect
3 9 14 2 2. rect
4.0141958743333817e-003 threshold
0.0337941907346249 left value
0.8378106951713562 right value
If u know what these values are represent plese give me solution
i assume following please correct me if i am wrong
1) there are 21 stage each stage contain weak classifier
2)3 7 14 -1 represent the rectangle where 3 and 7 (are corodinates of pixel that we need to sum for bright area )14 width and 4 height of image amd multiple that sumt with -1 (weight)
3)3 9 14 2 2 2 is a rect similar to above for dark area and calculate sum and multiple it with weight
4) now make the substraction from values in step (2) and (3) if sutraction < threshold then add left value else add right value
si=milarly for all feature in that stage now add all values from all feature if it is less than stage thershold then go for next stage else reject that area for detection
(5)up to how much stage i need to pass to confirm that it is a face is all
4.0141958743333817e-003 threshold what is reperesnt either the complete exponential value
or threshold range in between 4.0141958743333817e 3
please correct me if i am wrong
thanks in advance