Deep Learning for Computer Vision final project

Overview

Deep Learning for Computer Vision final project

Team: DLCV1

Member & Contribution:

  • 林彥廷 (R06943184): 主程式撰寫、模型訓練 (50%)
  • 王擎天 (R06945055): 副程式撰寫、模型訓練、海報設計 (50%)

Overview:

This project contains code to predict image's type from different domain using moment matching.

Description:

Folders:

  • script: folder contains scripts
  • src: folder contains source code
  • model: folder contains saved models which automatically download from network

Files:

  • script/get_dataset.sh: script which downloads training and testing dataset
  • script/download_from_gdrive.sh: script which downloads googledrive data
  • script/parse_data.sh: script which loads training dataset and converts to torch dataset
  • script/predict.sh: script which predicts images
  • script/evaluate.sh: script which evaluates the model
  • script/predict_for_verify.sh script which generates mini-batch average validation accuracy and loss plot
  • src/models/classifier.py: classifier model
  • src/models/loss.py: loss function
  • src/models/pretrained.py: pretrained model
  • src/models/model.py: Model and function for prediction and evaluation
  • src/parse_data.py: load data in folder and convert them to torch dataset
  • src/predict.py: prediction main function
  • src/evaluate.py: evaluation main function
  • src/train.py: training function
  • src/utils.py: code for parsing and saving
  • src/util/dataset.py: customized dataloader
  • src/util/visual.py: code for visualization
  • src/create_path_csv.py:main function to create image path csv file for image folder

Dataset:

Download training and testing dataset to folder named "dataset_public":

bash ./script/get_dataset.sh

WARNING:

You MUST use src/create_path_csv.py to create image-path csv file for image folder which hasn't contain image-path csv file, the usage will teach you how to use it!!!

Usage:

Create image-path csv file for image folder:

User can use this script to create image-path csv file

python3 src/create_path_csv.py $1
  • $1 is the folder containing the images

Example: (path: /home/final-dlcv1)

python3 src/create_path_csv.py dataset_public/test

The result will look like following text: image_name,label test/018764.jpg,-1 test/034458.jpg,-1 test/050001.jpg,-1 test/027193.jpg,-1 test/002637.jpg,-1 test/017265.jpg,-1 test/048396.jpg,-1 test/013178.jpg,-1 test/036777.jpg,-1 ......

Predict labels of images:

User can use this script to predict labels of images

bash ./script/predict.sh $1 $2 $3 $4 $5
  • $1 is the domain of images (Option: infograph, quickdraw, real, sketch)
  • $2 is the folder containing the images
  • $3 is the csv file contains image paths
  • $4 is the folder to saved the result file
  • $5 is the batch size

Example 1: Predict images from real domain (path: /home/final-dlcv1)

bash script/predict.sh real dataset_public dataset_public/test/image_path.csv predict 256

Example 2: Predict images from sketch domain (path: /home/final-dlcv1)

bash script/predict.sh sketch dataset_public dataset_public/sketch/sketch_test.csv predict 256

Example 3: Predict images from infograph domain (path: /home/final-dlcv1)

bash script/predict.sh infograph dataset_public dataset_public/infograph/infograph_test.csv predict 256

Example 4: Predict images from quickdraw domain (path: /home/final-dlcv1)

bash script/predict.sh quickdraw dataset_public dataset_public/quickdraw/quickdraw_test.csv predict 256

Evaluate the result file:

User can use this script to evaluate the reuslt file with answer file, it will print result on the screen

bash ./script/evaluate.sh $1 $2
  • $1 is the predicted file csv
  • $2 is the answer file csv

Example (path:/home/final-dlcv1)

bash ./script/evaluate.sh predict/real_predict.csv test/test_answer.csv

Reference

Owner
grassking100
A researcher study in bioinformatics and deep learning. To see other repositories: https://bitbucket.org/grassking100/?sort=-updated_on&privacy=public.
grassking100
Public repo for the ICCV2021-CVAMD paper "Is it Time to Replace CNNs with Transformers for Medical Images?"

Is it Time to Replace CNNs with Transformers for Medical Images? Accepted at ICCV-2021: Workshop on Computer Vision for Automated Medical Diagnosis (C

Christos Matsoukas 80 Dec 27, 2022
DeepConsensus uses gap-aware sequence transformers to correct errors in Pacific Biosciences (PacBio) Circular Consensus Sequencing (CCS) data.

DeepConsensus DeepConsensus uses gap-aware sequence transformers to correct errors in Pacific Biosciences (PacBio) Circular Consensus Sequencing (CCS)

Google 149 Dec 19, 2022
Simplified interface for TensorFlow (mimicking Scikit Learn) for Deep Learning

SkFlow has been moved to Tensorflow. SkFlow has been moved to http://github.com/tensorflow/tensorflow into contrib folder specifically located here. T

3.2k Dec 29, 2022
This repo is to be freely used by ML devs to check the GAN performances without coding from scratch.

GANs for Fun Created because I can! GOAL The goal of this repo is to be freely used by ML devs to check the GAN performances without coding from scrat

Sagnik Roy 13 Jan 26, 2022
Unofficial implementation of the Involution operation from CVPR 2021

involution_pytorch Unofficial PyTorch implementation of "Involution: Inverting the Inherence of Convolution for Visual Recognition" by Li et al. prese

Rishabh Anand 46 Dec 07, 2022
LSTMs (Long Short Term Memory) RNN for prediction of price trends

Price Prediction with Recurrent Neural Networks LSTMs BTC-USD price prediction with deep learning algorithm. Artificial Neural Networks specifically L

5 Nov 12, 2021
PyTorch Implementation of PortaSpeech: Portable and High-Quality Generative Text-to-Speech

PortaSpeech - PyTorch Implementation PyTorch Implementation of PortaSpeech: Portable and High-Quality Generative Text-to-Speech. Model Size Module Nor

Keon Lee 279 Jan 04, 2023
Multivariate Time Series Forecasting with efficient Transformers. Code for the paper "Long-Range Transformers for Dynamic Spatiotemporal Forecasting."

Spacetimeformer Multivariate Forecasting This repository contains the code for the paper, "Long-Range Transformers for Dynamic Spatiotemporal Forecast

QData 440 Jan 02, 2023
Official implementation for "Low-light Image Enhancement via Breaking Down the Darkness"

Low-light Image Enhancement via Breaking Down the Darkness by Qiming Hu, Xiaojie Guo. 1. Dependencies Python3 PyTorch=1.0 OpenCV-Python, TensorboardX

Qiming Hu 30 Jan 01, 2023
Using Tensorflow Object Detection API to detect Waymo open dataset

Waymo-2D-Object-Detection Using Tensorflow Object Detection API to detect Waymo open dataset Result CenterNet Training Loss SSD ResNet Training Loss C

76 Dec 12, 2022
Code for "On the Effects of Batch and Weight Normalization in Generative Adversarial Networks"

Note: this repo has been discontinued, please check code for newer version of the paper here Weight Normalized GAN Code for the paper "On the Effects

Sitao Xiang 182 Sep 06, 2021
Geometric Vector Perceptrons --- a rotation-equivariant GNN for learning from biomolecular structure

Geometric Vector Perceptron Implementation of equivariant GVP-GNNs as described in Learning from Protein Structure with Geometric Vector Perceptrons b

Dror Lab 142 Dec 29, 2022
A minimal TPU compatible Jax implementation of NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis

NeRF Minimal Jax implementation of NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis. Result of Tiny-NeRF RGB Depth

Soumik Rakshit 11 Jul 24, 2022
Real-CUGAN - Real Cascade U-Nets for Anime Image Super Resolution

Real Cascade U-Nets for Anime Image Super Resolution 中文 | English 🔥 Real-CUGAN

tarsin 111 Dec 28, 2022
Multi-modal Vision Transformers Excel at Class-agnostic Object Detection

Multi-modal Vision Transformers Excel at Class-agnostic Object Detection

Muhammad Maaz 206 Jan 04, 2023
This tool converts a Nondeterministic Finite Automata (NFA) into a Deterministic Finite Automata (DFA)

This tool converts a Nondeterministic Finite Automata (NFA) into a Deterministic Finite Automata (DFA)

Quinn Herden 1 Feb 04, 2022
Locationinfo - A script helps the user to show network information such as ip address

Description This script helps the user to show network information such as ip ad

Roxcoder 1 Dec 30, 2021
General neural ODE and DAE modules for power system dynamic modeling.

Py_PSNODE General neural ODE and DAE modules for power system dynamic modeling. The PyTorch-based ODE solver is developed based on torchdiffeq. Sample

14 Dec 31, 2022
SHRIMP: Sparser Random Feature Models via Iterative Magnitude Pruning

SHRIMP: Sparser Random Feature Models via Iterative Magnitude Pruning This repository is the official implementation of "SHRIMP: Sparser Random Featur

Bobby Shi 0 Dec 16, 2021
Pytorch implementation of Generative Models as Distributions of Functions 🌿

Generative Models as Distributions of Functions This repo contains code to reproduce all experiments in Generative Models as Distributions of Function

Emilien Dupont 117 Dec 29, 2022