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
Combinatorially Hard Games where the levels are procedurally generated

puzzlegen Implementation of two procedurally simulated environments with gym interfaces. IceSlider: the agent needs to reach and stop on the pink squa

Autonomous Learning Group 3 Jun 26, 2022
PyTorch implementation of the paper Ultra Fast Structure-aware Deep Lane Detection

PyTorch implementation of the paper Ultra Fast Structure-aware Deep Lane Detection

1.4k Jan 06, 2023
RLBot Python bindings for the Rust crate rl_ball_sym

RLBot Python bindings for rl_ball_sym 0.6 Prerequisites: Rust & Cargo Build Tools for Visual Studio RLBot - Verify that the file %localappdata%\RLBotG

Eric Veilleux 2 Nov 25, 2022
TensorFlow Metal Backend on Apple Silicon Experiments (just for fun)

tf-metal-experiments TensorFlow Metal Backend on Apple Silicon Experiments (just for fun) Setup This is tested on M1 series Apple Silicon SOC only. Te

Timothy Liu 161 Jan 03, 2023
PyTorch implementation of SmoothGrad: removing noise by adding noise.

SmoothGrad implementation in PyTorch PyTorch implementation of SmoothGrad: removing noise by adding noise. Vanilla Gradients SmoothGrad Guided backpro

SSKH 143 Jan 05, 2023
Pytorch implementation of FlowNet by Dosovitskiy et al.

FlowNetPytorch Pytorch implementation of FlowNet by Dosovitskiy et al. This repository is a torch implementation of FlowNet, by Alexey Dosovitskiy et

Clément Pinard 762 Jan 02, 2023
Extremely easy multi instancing software for minecraft speedrunning.

Easy Multi Extremely easy multi/single instancing software for minecraft speedrunning. A couple of goals of this project: Setup multi in minutes No fi

Duncan 8 Jul 16, 2022
The code for paper Efficiently Solve the Max-cut Problem via a Quantum Qubit Rotation Algorithm

Quantum Qubit Rotation Algorithm Single qubit rotation gates $$ U(\Theta)=\bigotimes_{i=1}^n R_x (\phi_i) $$ QQRA for the max-cut problem This code wa

SheffieldWang 0 Oct 18, 2021
[ WSDM '22 ] On Sampling Collaborative Filtering Datasets

On Sampling Collaborative Filtering Datasets This repository contains the implementation of many popular sampling strategies, along with various expli

Noveen Sachdeva 17 Dec 08, 2022
Massively parallel Monte Carlo diffusion MR simulator written in Python.

Disimpy Disimpy is a Python package for generating simulated diffusion-weighted MR signals that can be useful in the development and validation of dat

Leevi 16 Nov 11, 2022
Intrinsic Image Harmonization

Intrinsic Image Harmonization [Paper] Zonghui Guo, Haiyong Zheng, Yufeng Jiang, Zhaorui Gu, Bing Zheng Here we provide PyTorch implementation and the

VISION @ OUC 44 Dec 21, 2022
Implementation of "Learning Multi-Granular Hypergraphs for Video-Based Person Re-Identification"

hypergraph_reid Implementation of "Learning Multi-Granular Hypergraphs for Video-Based Person Re-Identification" If you find this help your research,

62 Dec 21, 2022
Based on the paper "Geometry-aware Instance-reweighted Adversarial Training" ICLR 2021 oral

Geometry-aware Instance-reweighted Adversarial Training This repository provides codes for Geometry-aware Instance-reweighted Adversarial Training (ht

Jingfeng 47 Dec 22, 2022
XtremeDistil framework for distilling/compressing massive multilingual neural network models to tiny and efficient models for AI at scale

XtremeDistilTransformers for Distilling Massive Multilingual Neural Networks ACL 2020 Microsoft Research [Paper] [Video] Releasing [XtremeDistilTransf

Microsoft 125 Jan 04, 2023
Dataset and codebase for NeurIPS 2021 paper: Exploring Forensic Dental Identification with Deep Learning

Repository under construction. Example dataset, checkpoints, and training/testing scripts will be avaible soon! 💡 Collated best practices from most p

4 Jun 26, 2022
Plato: A New Framework for Federated Learning Research

a new software framework to facilitate scalable federated learning research.

System <a href=[email protected] Lab"> 192 Jan 05, 2023
A High-Performance Distributed Library for Large-Scale Bundle Adjustment

MegBA: A High-Performance and Distributed Library for Large-Scale Bundle Adjustment This repo contains an official implementation of MegBA. MegBA is a

旷视研究院 3D 组 336 Dec 27, 2022
Official Pytorch implementation for AAAI2021 paper (RSPNet: Relative Speed Perception for Unsupervised Video Representation Learning)

RSPNet Official Pytorch implementation for AAAI2021 paper "RSPNet: Relative Speed Perception for Unsupervised Video Representation Learning" [Suppleme

35 Jun 24, 2022
Reproducing Results from A Hybrid Approach to Targeting Social Assistance

title author date output Reproducing Results from A Hybrid Approach to Targeting Social Assistance Lendie Follett and Heath Henderson 12/28/2021 html_

Lendie Follett 0 Jan 06, 2022
An Official Repo of CVPR '20 "MSeg: A Composite Dataset for Multi-Domain Segmentation"

This is the code for the paper: MSeg: A Composite Dataset for Multi-domain Semantic Segmentation (CVPR 2020, Official Repo) [CVPR PDF] [Journal PDF] J

226 Nov 05, 2022