Questions tagged [downsampling]
231 questions
3
votes
0 answers
How can I do a stratified downsampling?
I need to build a classification model for protein sequences using machine learning techniques. Each observation can either be classified as either a 0 or a 1. However, I noticed that my training set contains a total of 170 000 observations, of…

Rafael Garcia
- 91
- 2
- 7
3
votes
2 answers
Downsampling continuous variable to uniform distribution
Given a distribution, let's say, a gaussian:
import pandas as pd
import numpy as np
gaussian_distribution = np.random.normal(0,1,10_000)
This sample looks like this:
What I want to do is to resample this distribution to somehow get a uniform…

Victor Maricato
- 672
- 8
- 25
3
votes
3 answers
Downsampling Images with SwiftUI
I'm displaying images in my app that are downloaded from the network, but I'd like to downsample them so they aren't taking up multiple MB of memory. I could previously do this quite easily with UIKit:
func resizedImage(image: UIImage, for size:…

bze12
- 727
- 8
- 20
3
votes
1 answer
Block reduce (downsample) 3D array with mode function
I would like to downsample a 3d array by taking the most frequent value (mode) of the original values. After some research, I found the block_reduce function in skimage library. For example, if I wanted like to take the average of the block, I can…

user2847666
- 119
- 10
3
votes
2 answers
Looking for fastest method to downsample a 3d array based on occurences using numpy
Given a large 3d numpy array (not too large to fit in memory) with type 'uint8', I would like to downscale this array with a given scalefactor in each dimension. You may assume the shape of the array is dividable by the scale factor.
The values of…

F.Wessels
- 179
- 11
3
votes
0 answers
Down sampling point clouds with open3d
I'm using the python bindings of open3d to down sample a point cloud. The library offers two methods to do so using voxels: voxel_down_sample and voxel_down_sample_with_trace
While the first returns only a down sampled point cloud, the latter…

Zachi Shtain
- 826
- 1
- 13
- 31
3
votes
1 answer
Fastest way to bulk downsize jpeg images
If hardware is not a limiting factor, what's the fastest way to take a large amount of high-res jpeg images and downsize them all? For example, if I have a folder of 20,000 jpeg images that vary in aspect ratio, but are all fairly large (near 4k…

Austin
- 6,921
- 12
- 73
- 138
3
votes
0 answers
How to use (imblearn.keras import BalancedBatchGenerator) with more than two dem array X_train?
I'm building a CNN model trained on imbalanced dataset using Keras. I'm working on data re-sampling using imblearn.keras.balanced_batch_generator
provided by imblearn.
My x_train array is of shape (n_samples, 32, 32, 1) while fit_generator for…

user2340286
- 69
- 1
- 6
3
votes
1 answer
Down sampling in python
I'm trying to downsample my data which is minute and my index is date time. But when i call pandas.resample it returns only one column while my data contains six columns
import pandas as pd
from matplotlib import pyplot
dataset =…

imtiaz ul Hassan
- 358
- 3
- 14
3
votes
1 answer
Downsampling point clouds to specific number of points while retaining shape
Environment: Python-PCL, WIndows 10, Python 3.6
I need to downsample point clouds to a specific number of points. These point clouds vary in size and hence I am stuck. From going through documentation, I understand there are only
VoxelGrid,…

kav
- 65
- 4
- 10
3
votes
1 answer
how to use very high resolution images with VGG16 or InceptionV3
I have a data set of bacteria images taken from under a microscope and recorded using a high resolution camera. The images are of resolution 800x600 and in another data set (taken from a different microscope) the resolution is about 5312x2988.…

saurabh kumar
- 131
- 1
- 8
3
votes
1 answer
Efficient way of downsample collection via decimating or extracting every nth element in Swift
I'm trying to downsample a long collection by decimating or extracting every nth element.
Here's what I got for my array extension:
func downsampled(to threshold: Int) -> [T] {
// Validate that threshold falls in valid range
guard !isEmpty,…

TruMan1
- 33,665
- 59
- 184
- 335
3
votes
0 answers
How could I downscale images with kivy/python with good results?
I am trying to display images at a smaller size then their source and while I have achieved this, the quality is horrible on any resolution other then 1080p. Here's my code thus far:
import random
from kivy.app import App
from kivy.uix.widget import…

Electromagnetism
- 101
- 2
- 5
3
votes
1 answer
How to perform undersampling (the right way) with python scikit-learn?
I am attempting to perform undersampling of the majority class using python scikit learn. Currently my codes look for the N of the minority class and then try to undersample the exact same N from the majority class. And both the test and training…

KubiK888
- 4,377
- 14
- 61
- 115
3
votes
1 answer
Fast organised point cloud registration
I have been looking for methods to register (align) organized point clouds with normal information.
I could only find generic point cloud registration methods (for example in PCL).
I am using Microsoft Kinect to get my point clouds, but the…

Snowman
- 1,503
- 1
- 17
- 39