File size: 1,691 Bytes
e942d15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
"""

Smoker Detection with LoRA Fine-Tuning



A parameter-efficient approach to binary image classification using 

Low-Rank Adaptation (LoRA) on pretrained ResNet34.

"""

from .model import (
    LoRALayer,
    get_model,
    apply_lora_to_model,
    count_parameters
)

from .dataset import (
    SmokerDataset,
    get_transforms,
    create_dataloaders
)

from .train import (
    train_one_epoch,
    validate,
    train_model,
    get_optimizer_and_criterion
)

from .evaluate import (
    evaluate_model,
    print_classification_report,
    plot_confusion_matrix,
    plot_training_history,
    get_predictions_with_confidence,
    analyze_errors
)

from .utils import (
    set_seed,
    get_device,
    save_checkpoint,
    load_checkpoint,
    visualize_samples,
    print_dataset_info,
    create_directories,
    count_dataset_images
)

__version__ = '1.0.0'
__author__ = 'Your Name'

__all__ = [
    # Model
    'LoRALayer',
    'get_model',
    'apply_lora_to_model',
    'count_parameters',
    
    # Dataset
    'SmokerDataset',
    'get_transforms',
    'create_dataloaders',
    
    # Training
    'train_one_epoch',
    'validate',
    'train_model',
    'get_optimizer_and_criterion',
    
    # Evaluation
    'evaluate_model',
    'print_classification_report',
    'plot_confusion_matrix',
    'plot_training_history',
    'get_predictions_with_confidence',
    'analyze_errors',
    
    # Utils
    'set_seed',
    'get_device',
    'save_checkpoint',
    'load_checkpoint',
    'visualize_samples',
    'print_dataset_info',
    'create_directories',
    'count_dataset_images',
]