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
Self-Supervised Pre-Training for Transformer-Based Person Re-Identification

Self-Supervised Pre-Training for Transformer-Based Person Re-Identification [pdf] The official repository for Self-Supervised Pre-Training for Transfo

Hao Luo 116 Jan 04, 2023
Using PyTorch Perform intent classification using three different models to see which one is better for this task

Using PyTorch Perform intent classification using three different models to see which one is better for this task

Yoel Graumann 1 Feb 14, 2022
This repository accompanies the ACM TOIS paper "What can I cook with these ingredients?" - Understanding cooking-related information needs in conversational search

In this repository you find data that has been gathered when conducting in-situ experiments in a conversational cooking setting. These data include tr

6 Sep 22, 2022
Minimisation of a negative log likelihood fit to extract the lifetime of the D^0 meson (MNLL2ELDM)

Minimisation of a negative log likelihood fit to extract the lifetime of the D^0 meson (MNLL2ELDM) Introduction The average lifetime of the $D^{0}$ me

Son Gyo Jung 1 Dec 17, 2021
This repo is official PyTorch implementation of MobileHumanPose: Toward real-time 3D human pose estimation in mobile devices(CVPRW 2021).

Github Code of "MobileHumanPose: Toward real-time 3D human pose estimation in mobile devices" Introduction This repo is official PyTorch implementatio

Choi Sang Bum 203 Jan 05, 2023
PyTorch implementation of Tacotron speech synthesis model.

tacotron_pytorch PyTorch implementation of Tacotron speech synthesis model. Inspired from keithito/tacotron. Currently not as much good speech quality

Ryuichi Yamamoto 279 Dec 09, 2022
Implementation of "Glancing Transformer for Non-Autoregressive Neural Machine Translation"

GLAT Implementation for the ACL2021 paper "Glancing Transformer for Non-Autoregressive Neural Machine Translation" Requirements Python = 3.7 Pytorch

117 Jan 09, 2023
A super lightweight Lagrangian model for calculating millions of trajectories using ERA5 data

Easy-ERA5-Trck Easy-ERA5-Trck Galleries Install Usage Repository Structure Module Files Version iteration Easy-ERA5-Trck is a super lightweight Lagran

Zhenning Li 26 Nov 19, 2022
TensorFlow implementation of Barlow Twins (Barlow Twins: Self-Supervised Learning via Redundancy Reduction)

Barlow-Twins-TF This repository implements Barlow Twins (Barlow Twins: Self-Supervised Learning via Redundancy Reduction) in TensorFlow and demonstrat

Sayak Paul 36 Sep 14, 2022
Pull sensitive data from users on windows including discord tokens and chrome data.

⭐ For a 🍪 Pegasus Pull sensitive data from users on windows including discord tokens and chrome data. Features 🟩 Discord tokens 🟩 Geolocation data

Addi 44 Dec 31, 2022
Code for the Interspeech 2021 paper "AST: Audio Spectrogram Transformer".

AST: Audio Spectrogram Transformer Introduction Citing Getting Started ESC-50 Recipe Speechcommands Recipe AudioSet Recipe Pretrained Models Contact I

Yuan Gong 603 Jan 07, 2023
A program to recognize fruits on pictures or videos using yolov5

Yolov5 Fruits Detector Requirements Either Linux or Windows. We recommend Linux for better performance. Python 3.6+ and PyTorch 1.7+. Installation To

Fateme Zamanian 30 Jan 06, 2023
Image-to-image regression with uncertainty quantification in PyTorch

Image-to-image regression with uncertainty quantification in PyTorch. Take any dataset and train a model to regress images to images with rigorous, distribution-free uncertainty quantification.

Anastasios Angelopoulos 25 Dec 26, 2022
NaturalCC is a sequence modeling toolkit that allows researchers and developers to train custom models

NaturalCC NaturalCC is a sequence modeling toolkit that allows researchers and developers to train custom models for many software engineering tasks,

159 Dec 28, 2022
Semantic code search implementation using Tensorflow framework and the source code data from the CodeSearchNet project

Semantic Code Search Semantic code search implementation using Tensorflow framework and the source code data from the CodeSearchNet project. The model

Chen Wu 24 Nov 29, 2022
FAMIE is a comprehensive and efficient active learning (AL) toolkit for multilingual information extraction (IE)

FAMIE: A Fast Active Learning Framework for Multilingual Information Extraction

18 Sep 01, 2022
QRec: A Python Framework for quick implementation of recommender systems (TensorFlow Based)

Introduction QRec is a Python framework for recommender systems (Supported by Python 3.7.4 and Tensorflow 1.14+) in which a number of influential and

Yu 1.4k Dec 30, 2022
[ACL 20] Probing Linguistic Features of Sentence-level Representations in Neural Relation Extraction

REval Table of Contents Introduction Overview Requirements Installation Probing Usage Citation License 🎓 Introduction REval is a simple framework for

13 Jan 06, 2023
Pretrained models for Jax/Flax: StyleGAN2, GPT2, VGG, ResNet.

Pretrained models for Jax/Flax: StyleGAN2, GPT2, VGG, ResNet.

Matthias Wright 169 Dec 26, 2022
Supervision Exists Everywhere: A Data Efficient Contrastive Language-Image Pre-training Paradigm

DeCLIP Supervision Exists Everywhere: A Data Efficient Contrastive Language-Image Pre-training Paradigm. Our paper is available in arxiv Updates ** Ou

Sense-GVT 470 Dec 30, 2022