-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GAN+BetaVAE models #1
Open
AtarSander
wants to merge
65
commits into
KNSI-Golem:main
Choose a base branch
from
AtarSander:betavae
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…sample image from NuImages dataset. - new file car_finder with class CarFinder - function fetch_vehicles_bounding_boxes iterates through each object and checks if its a vehicle
…es bounding boxes for each image in dataset. - function iterates through images in dataset and uses fetch_vehicles_bboxes_from_img to get bounding boxes of all vehicles
…mages of cars from given bounding boxes. Minor names changes in car_finder. - function cut_out_bbox uses cv2 library for cutting an image fragment where the car is positioned - function cut_out_vehicles iterates through dataset and cuts out all of vehicles there - in car_finder changed names for clarity
…nder. - check_bbox_size checks if bounding box of a vegicle is not below given threshold - implemented check_bbox_size into fetch_vehicles_bboxes_from_img
…for possible data pruning/augmentation in the future. Added .gitignore. - functions brigthness, sharpness, focus, contrast, noise_frequency, color_balance, uniformity measure different image metrics - their results are added into dictionary in function analyze_image - set image enables changing an image without creating new object
… For now it resizes images to one, target width and size. Created requirements file. - DataPreprocessor consist of function is_too_small which is used in resize_image for checking what type of interpolation to use for the best effect - deleted old commented code from image_quality_analyzer
…eQualityAnalyzer and DataPreprocessor - created analyze_dataset function which iterates through filenames in given directory and calculates metrics for each image - created resize dataset which iterates through filenames in given directory and resizes each image
- created Generator model class for generating images from noise input - created Discriinator model class for veryfiying image accuracy
… model. - Generator and Discriminator created on init, needed parameters passed as init arguments - traning happens inside train function which is split into smaller parts - separated functions for initializing weights, optim setup, loss calculations, backprop and evaluation to keep the code clean
…lasses. - both models use xavier normal init for Conv2d or ConvTranspose2d layers and constant init for BatchNorm2d layers
- fixed nn.Module inheritance in, added forward methods - fixed optimizer arguments in GAN, added retain_graph to backprop - deleted comment in carfinder
- load_dataset uses torchvision.transforms for chaning input images into traning data for GAN model.
…odel. Updated requirements, and GAN class. - test.py uses all of the class components to first extract and preprocess training data, and then train the model. - torch and matplotlib added to requirements - plots now saved as a file in GAN.
- created src folder for cleaner structure - fixed import paths
…odel.py, implemented weights saving and added progress bar to car_cutter. - In GAN, Generator and Discriminator fixed cuda usage so it works for every step of the training. - Implemented models weights saving in GAN. New directory models created for keeping the weights. - Added progress bar to cut_out_vehicles_from_dataset function in CarCutter to keep note of the progress (it takes a lot of time).
GAN network performs training without crashing or returning errors. In this state it doesn't provide satisfying results after training (work needed with parameters tuning).
… measurement per epoch, implemented tensorboard visualization. - in model.py changed features dimension in convolutional blocks for both generator and discriminator - in gan.py implemented elapsed time measurement per epoch for training - in gan.py added temporary implementation of tensorboard visualization for training
- label loop iterates through given directory files - it uses label_file to pick if the car is placed front, back or sideways to camera (or bad picture and discard) - it is possible to pick sort_type - it is possible to print images in cv2 window while labeling
…dded labeler class and labeling script to enable labeling images, started work on data augmeneter. - in traning loop comented epoch end condition and implemented time constraints - created class labeler for labeling images to correct subdirectories - labeling script enables same thing with different technique - data augmenter implements function for creating similar images to the original
- implemented flipping, rotating, brightness and contrast adjusting and gaussian noise application functions - augment_dataset function iterates through a folder and creates 6 more variations of each image
…ories. - added .vscode to .gitignore - fixed path passing in data augmenter - added line clearing in terminal for progress bar and implemented it in classes using the progress bar - implemented giving path to logs in GAN manually
- logs directory consists of fake and real subdir for tensorboard log keeping
Version 1.0
…, removed unused code in gan, fixed types in model eval. - implemented try-except handling within commands in ADShell, especially ones with parameters passed from terminal - fixed bugged model calls in ADShell - changed name of .json config file, added additional parameters for complete training flexilibty - corrected types in both model_eval and ADShell
- added link to dataset in kaggle - added instalation instruction - implemented usage guide with separate section for training, inference and evaluation - added images of generated cars - grammar corrections
- class inherits from nn.Module - it consists of encoder and decoder with helper functions for building them - they are joined in forward method together with reparametrize
…taVAETrainer class. - removed beta parameter from beta_vae class (it's needed for training, not creating the model) - added weights initialization for decoder and encoder - created rough draft of BetaVAETrainer class for training process with data loading, forward prop, loss calculation and backpropagation
…py, updated autodoppelganger shell for betavae. - fixed wrong arguments passing in beta_vae - added weights saving and loading into BetaVAETrainer - added printing training_stats - added generating samples - implemented commands in adshell for betavae usage
- Added normalization for GAN generation. - Implemented cpu usage in both models generation.
- generate disentangled samples in both ad shell and train - added more error catching
- replaced old style data resizing with appropriate torchvision transformations - added many data augmentations transformation in place of unused data augmentation class
- removed unecessary blank line in train.py - removed test print statement in gan - corrected mean transformation in data_preprocessor
- implemented saving of weight every 20 epoch in train.py - updated autodoppelganger_shell accordingly
…training is finished. - updated json config file - changed weight saving logic in adshell (for bvae only)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Project consists of two separate models created for car images generation: