Here I am going to reproduce the results of an ML Article
The main resource is https://github.com/xmed-lab/UCVME.
Mohammad Javad Maheronnaghsh
The goal is to reproduce the results of an article, and report the results and the way and details of doing that in this repository. Thie name of the article is: "Semi-Supervised Deep Regression with Uncertainty Consistency and Variational Model Ensembling via Bayesian Neural Networks".
Due to the use of proxies in Iran, when I wanted to clone from https://github.com/xmed-lab/UCVME.git, I faced a problem: Unable to clone because of proxy.com. To solve this problem, I entered "git config --global --unset http.proxy" in gitbash and this problem is resolved. Now I can clone from the main repository.
This may happen because we have forgotten to donwload and place the dataset in the correct place.
To install CV2 package it is neccessary to install OpenCV in python (not cv2), because there is no module named "cv2" that is recognizable for Pycharm.
First of all, I have cloned from the main repository (https://github.com/xmed-lab/UCVME.git) in Pycharm (locally).
In this step, I have downloaded the dataset from https://susanqq.github.io/UTKFace/. In this webpage, I have downloaded the "Aligned&Cropped Faces" zip file, then etracted it and copied and pasted the images into the UTKFace directory in the cloned ptoject. Note that if we forget to download the dataset, we are going to face an exception (Not Found Exception).
I opened the "init.py" file and installed the neccessary (and not-installed) libraries to my directory. This task can be done in 3 ways: -- Use another Configuration in Pycharm that satisfies the needed libraries. -- Intall the libraries by entering the proper command in command line. -- Simply Click "Alt+Enter" on the red part of the code (which is the not-satisfied library) and click on "Install Package".
It is also neccessary to add the libraries to "requirements.txt" file.
We can start training process by writing this command (python3 ucvme_age.py --output='out') in the terminal.
When we start trainig, first resnet starts to download:
Then the images are trained, etc. as wee can see in the below screenshot.
After entering this (python3 ucvme_age.py --output='out' --test_only) in the terminal, we can see the below picture that the pictures are on the test:
We can check the outputs of our code running in the "out" directory that I have created in my own project.
There is a "log.csv" that is a report of want we have run.
- I have done these processes in Windows 10. It can be done in Linux, too.
- I suggest to place the dataset in the main github repository, so we can train and test the model easily.
- I suggest to use another function instead of "imread" because Pycharm preferes to use the other methods.
- I suggest to create different repositores so we can update and add some comments to the github repository. In the current version, we only have a main branch that is not good for improving big projects and codes.