Tag Archives: numpy

The generating speed for random number in Python3

Just want to generate random number in a range (no matter float or integer) by using Python. Since I only need to get a random number in my code once a time, the speed for calling the generating-function is critical. So let’s do the experiment:

The result is:

Read more »

Tips about Numpy and PyTorch

1. Type convertion in Numpy Here is my code:

Guess what? The type of variable ‘c’ is ‘float64’! Seems Numpy automatically considers a empty array of Python as ‘float64’ type. So the correct code should be:

This time, the type of ‘c’ is ‘int64’ 2. Convert a tensor… Read more »

Using Single Shot Detection to detect birds (Episode three)

In the previous article, I reached mAP 0.740 for VOC2007 test. After one month, I found out that the key to boost the performance of object detction is not only based on cutting edge model, but also depends on sophisticated augmentation methodology. Therefore I manually checked every image generated by… Read more »

Some tips for opencv-python

      No Comments on Some tips for opencv-python

Type conversion Using opencv-python to add object-detection rectangle for the image:

The result looks like this But in a more complicated program, I processed a image from float32 type. Therefore the code looks like:

But this time, the rectangle disappeared. The reason is opencv-python use numpy array for… Read more »

Some errors in dataset pipeline of Tensorflow

To extend image datasets by using mixup´╝îI use this snippet to mix two images:

But after generating images by using this snippet, the training report errors:

The size of each image is 512x512x4 = 1048576 bytes. But I can’t understand why there is image has the size of… Read more »