How can extract an image dataset using Neural Network? [closed] - python

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am sorry for this type of questions! I searched a lot on google and youtube but i am failed to get the accurate knowledge for extracting an image dataset in a single time.
And after images extraction How should I save it as csv file?
Step by step it will be:
Extract the images Dataset
Save as CSV file
I prefer to extract image Dataset using Keras API module. But I am confused which module will be perfect to use and how should extract? I don't know!

That can be possible with some basic file handling and using libraries.
Check the following link, where images are loaded and saved as pickle files to be used in a neural network. These pickle files can be saved and loaded using a library pickle.
An image is stored as a numpy array which can be converted to csv. Check out the following link for this task.

Related

Is it possible to get contours from a picture without using opencv in python? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 days ago.
Improve this question
I'm having trouble installing opencv. Is it possible to get contours from a picture without using opencv in python?
You could iterate over the pixels using a for loop, darken each pixel until you’ve got your more prominent values, then create an array of vectors dependant on the outline, tensorflow posenet does this
OpenCV is more widely used for this purpose, but you can also do great things with:
Scikit-image find_contours measure: Check code & sample here
PIL/Pillow: For simpler uses. Check this example
Tensoflow: For more advanced use, there are some approaches too using Deep Learning for this. Just found this sample searching Github
Pytorch: Also via deep learning. Check this other sample

How to convert all images in one folder to numpy files? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I need to do Semantic image segmentation based on Unet.
I have to work with Pascal VOC 2012 dataset, however I don't know how to do it, do I manually select images for the train & val and convert them into numpy and then load them into the model? Or is there another way?
If this is the first one I would like to know how to convert all the images present in a folder into .npy.
if i understood correctly, you just need to go through all the files from the folder and add them to the numpy table?
numpyArrays = [yourfunc(file_name) for file_name in listdir(mypath) if isfile(join(mypath, file_name))]
yourfunc is the function you need to write to convert one file from dataset format to numpy table

Using python to convert wav file to csv file before feed the data into FFT for audio spectrum analyzer [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am working on a simple audio spectrum analyzer using FPGA. For the preprocessing part, my idea is to use python to convert wav file to csv file, and then feed the data to a fast fourier transform module. Is it possible to get it work?
There are plenty of available open source modules to perform this:
A GitHub repository for same.
Just open github and type wav to csv and you'll find quite a lot of them.
Or even google a bit and you can find lot of answers on same.
One small query though. You basically want to convert the .wav file into a time series data right?
In that case, I'll highly recommend to go through:
KDNugget's post about same.

How do I load a 14,000 image data-set into a variable without running out of memory? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm trying to make a function to load a large image data-set of 14,000 images into a variable but I'm running into memory (RAM) issues.
What I'm trying to make is something like a cifar100.load_data function but it's not working out for me.
The function I defined looks like this:
def load_data():
trn_x_names=os.listdir('data/train_x')
trn_y_names=os.listdir('data/train_y')
trn_x_list=[]
trn_y_list=[]
for image in trn_x_names[0:]:
img=cv2.imread('data/train_x/%s'%image)
img=cv2.cvtColor(img,cv2.COLOR_BGR2RGB)
trn_x_list.append(img)
for image in trn_y_names[0:]:
img=cv2.imread('data/train_y/%s'%image)
img=cv2.cvtColor(img,cv2.COLOR_BGR2RGB)
trn_y_list.append(img)
x_train= np.array(trn_x_list)
y_train= np.array(trn_y_list)
return x_train,y_train
I first load all the images one by one, adding them to corresponding lists and at the end changing those lists to a numpy array and assigning them to some variables and returning them. But on the way, I ran into RAM issues as it consumed 100 % of my RAM.
You need to read in your images in batches as opposed to loading the entire data set into memory. If you are using tensorflow use the ImageDataGenerator.flowfromdirectory. Documentation is here. If your data is not organized into sub directories then you will need to create a python generator that reads in the data in batches. You can see how to build such a generator here.. Set the batch size to a value say 30 that will not fill up your memory.

screen scrape alphanumeric chars from picture [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm trying to find a way to screen scrape the letters and numbers (mainly numbers) from the attached picture.
example picture
In previous attempts, I've used pyocr and many other variations.
My question is, has any body found a way to scrape off numbers? Or how to train the pyocr algorithm to use custom data?
Thanks in advance!
The folks at PyImageSearch have a TON of info about processing images in Python with OpenCV.
They even have a free blog post about using Tesseract OCR. Though Tesseract can be a bit fussy about fonts, the good news is it looks like your text in the image should always be the same font, and perfectly aligned horizontally and vertically.
(disclaimer: I'm a student of theirs; but I don't work for them)
https://www.pyimagesearch.com/2018/09/17/opencv-ocr-and-text-recognition-with-tesseract/

Categories

Resources