amineHorseman / facial-expression-recognition-using-cnn

Deep facial expressions recognition using Opencv and Tensorflow. Recognizing facial expressions from images or camera stream
GNU General Public License v3.0
446 stars 141 forks source link

[Enhacement] Automatic Dataset download #3

Open okbalefthanded opened 5 years ago

okbalefthanded commented 5 years ago

A good feature to automate the benchmarking is to add a module for automatic dataset download.

justanotherlad commented 5 years ago

@amineHorseman Hi ! I'd like to take up this issue. Can you please guide me how to proceed with it?

amineHorseman commented 5 years ago

Hi @swastikbanerjee07, thank you for your help

Currently, we have to manually donwload the following 2 files before using the training script:

The idea is to create a function that automatically download these 2 files when train.py or convert_fer2013_to_images_and_landmarks.py scripts are launched.

An easy way to do donwload a file in python 2 & 3 is to use urllib.request.urlretrieve function. But you have first to check if the file was not already downloaded before.

justanotherlad commented 5 years ago

Hi! I'm new to this thing, but extremely interested, so I'd be glad to get a lil bit more help.

  1. Should I import urllib and write the code in parameters.py? Or is these any other file where I should write the code? I'm not sure which file needs to be updated to fix this issue.
  2. What is the direct url for fer2013.csv?
  3. Can we directly import csv and give the url in the urllib.request function to import the data directly automatically?
  4. How to check if the file was downloaded before? :/ I don't get you 😞🤔
amineHorseman commented 5 years ago

Hi,

  1. yes you should import urllib, but do not write the code in parameters.py, instead create a new file. The parameters.py file is only reserved for configuration variables.
  2. you can find the link in the readme, just follow up the link and copy the URL of the download button
  3. no urllib will donwload the file, any file, then the convert_fer2013_to_images_and_landmarks.py will automatically read the csv file and load the data
  4. just check if the file fer2013.csv exists in the main folder, if not you donwload the file using urllib, if it exists you do nothing
TrieuLe0801 commented 4 years ago

Hi, I have a suggestion. I think you should use imageio instead of scipy.misc.imsave because I see the imsave is removed in new version of scipy. Please try it if you think it is necessary.

imrose23 commented 4 years ago

Hello, I am a newbie in machine learning and currently working on making own custom dataset of facial emotions for children with ASD. I could not understand the fer13.csv format. How the pixels were taken. There is a single column for the pixels. What does it mean? When I convert my dataset into CSV, it turned out like below. mydata

Thanks.

rohitbabugaddeti commented 4 years ago

Hi @amineHorseman

I am interested to do this task. Since this is an old issue, please let me know if it still needs to be done

Cheers!