semvec/pypi-packages huggingface dataset:
pthelper 0.1.2
pthelper - boilerplate code for training, logging and evaluation in PyTorch.
License: MIT
Requires Python: >=3.7
Keywords: artificial-intelligence,deep-learning,pytorch,ml,torchinfo,model

# `pthelper` - PyTorch
A python package containing the basic boilerplate code for training and evaluation of PyTorch models. The main purpose of this package is to remove writing the same code for training/inference again and again for different projects. 

Apart from training and evaluation, it also contains other helper functions to perform logging stats in the console as well as Keras like model summaries using [torchinfo](https://github.com/TylerYep/torchinfo) package.

## Install
```pip install pthelper```

## Usage
**Utility functions**
- Print model details:
```python
from pthelper import utils

model = PyTorchModel()
input_size = (4, 28*28)
device = torch.device('cpu')
utils.model_details(model, input_size, device)
```

![model_summary](assets/model_summary.png)

**Model training and evaluation**
- Train the model:
```python
import torch
import torch.nn as nn
from pthelper import trainer, utils

epochs = 5
model = PyTorchModel()
loss_fn = nn.BCEWithLogitsLoss()
optimizer = torch.optim.SGD(model.parameters(), lr=0.01)
logger = utils.get_logger()
pt_trainer = trainer.PTHelper(model, loss_fn, optimizer, logger, num_classes=1)
for i in range(epochs):
    train_loss = pt_trainer.train(train_dataloader, epoch=i)
    valid_loss, predictions, targets = pt_trainer.evaluate(valid_dataloader)
```

## Scope
Right now, only binary and multi-class classification tasks are supported. In future releases, more functionality will be added like autoencoders, RNNs, GANs, etc.
pyqt-tab-widget 0.0.1
PyQt QTabWidget which is the most common type. This has a lot of common features such as close a tab, close tabs to the left/right, close other tabs and so on.
License: MIT


# pyqt-tab-widget
PyQt QTabWidget which is the most common type (if you doubt it, see the 'feature' section below). This has a lot of common features such as close a tab, close tabs to the left/right, close other tabs and so on.

## Requirements
* PyQt5 >= 5.8

## Setup
`python -m pip install pyqt-tab-widget`

## Feature
* List which is able to do with context menu
  * close a tab
  * close tabs to the left
  * close tabs to the right
  * close other tabs
  * close all tabs
  * reopen closed tab
* Alt+Left to change the current tab to the very left tab
* Alt+Right to change the current tab to the very right tab
* Ctrl+F4 to close current tab
* Close any tabs with clicking the close button (close button's style is defaut, i will customize it)

## Example
Code Sample

```python
from PyQt5.QtWidgets import QApplication, QWidget, QMainWindow
from pyqt_tab_widget import TabWidget


class MainWindow(QMainWindow):
  def __init__(self):
    super().__init__()
    self.__initUi()

  def __initUi(self):
    tabWidget = TabWidget()
    tabWidget.addTab(QWidget(), 'A')
    tabWidget.addTab(QWidget(), 'B')
    tabWidget.addTab(QWidget(), 'C')
    tabWidget.addTab(QWidget(), 'D')
    tabWidget.addTab(QWidget(), 'E')
    self.setCentralWidget(tabWidget)


if __name__ == "__main__":
  import sys

  app = QApplication(sys.argv)
  mainWindow = MainWindow()
  mainWindow.show()
  sys.exit(app.exec_())
```

Result

![image](https://user-images.githubusercontent.com/55078043/153697769-5134c02a-9cb8-4759-ae8a-53caae219659.png)
pyqt-top-left-right-file-list-widget 0.0.1
Simple PyQt Widget which contains QListWidget and add, delete QPushButton to add and delete file in the list
License: MIT


# pyqt-top-left-right-file-list-widget
Simple PyQt widget which contains QListWidget and add, delete QPushButton to add and delete file in the list

## Requirements
PyQt5 >= 5.8

## Setup
`python -m pip install pyqt-top-left-right-file-list-widget`

## Included packages
* <a href="https://github.com/yjg30737/simplePyQt5.git">simplePyQt5</a>
* <a href="https://github.com/yjg30737/pyqt-file-list-widget.git">pyqt-file-list-widget</a>
* <a href="https://github.com/yjg30737/pyqt-svg-icon-pushbutton.git">pyqt-svg-icon-pushbutton</a>

## Detailed Description
* Being able to add files to list, select multiple files on the list to delete, clear list.
* Being able to drop the files to the list
* Check the duplicated files' name
* User can able to choose the option to show files' name as absolute name or base name with "Show file name only" checkbox. 
* `setLabel(text: str)` - Set the label at the left side.
* `setExtensions(ext_lst: list)` - Define the specific extensions to add.
* `setDuplicateEnabled(f: bool)` - Allow to add duplicate name to list.
* `isDuplicateEnabled() -> bool` 

## Example
Code Example
```python
from PyQt5.QtWidgets import QApplication
from pyqt_top_left_right_file_list_widget.topLeftRightFileListWidget import TopLeftRightFileListWidget


if __name__ == "__main__":
    import sys

    app = QApplication(sys.argv)
    topLeftRightFileListWidget = TopLeftRightFileListWidget()
    topLeftRightFileListWidget.show()
    app.exec_()
```

Result

![image](https://user-images.githubusercontent.com/55078043/161471903-e036a628-85b9-4bf7-bb55-d73b41596cb8.png)

Show file name only

![image](https://user-images.githubusercontent.com/55078043/161471920-4e8dace5-00ea-46e9-8652-731a1dc488bf.png)

You can select multiple files on the list. If at least one file is selected, delete button(red dash icon) will be clickable.

![image](https://user-images.githubusercontent.com/55078043/161471941-077dc58a-6490-4148-82eb-5ece2d31e13a.png)

Click it and selected ones will be removed from the list.

![image](https://user-images.githubusercontent.com/55078043/161472073-794cdaca-2d91-4647-bb3a-3a4c74db3902.png)

If some of files you want to add already exist in the list, Notice dialog will pop up to show you which files exist in the list. If you click OK, it will add files which are not duplicated. Otherwise none of files you want to add will be on the list.

![image](https://user-images.githubusercontent.com/55078043/145380501-1907ec13-31f8-483d-9fa7-5cb6d2ed440a.png)

## Note

I'm currently working with "Don't ask again" feature. Hope you don't mind.
pyqt-vbounding-box 0.0.11
PyQt QGraphicsView with bounding box. User can move horizontal border of the box vertically.
License: MIT


# pyqt-vbounding-box
PyQt QGraphicsView with bounding box. User can move horizontal border of the box vertically.

## Requirements
* PyQt5 >= 5.8

## Setup
`python -m pip install pyqt-vbounding-box`

## Feature
* Being able to drag and drop horizontal border vertically
* Pressing mouse cursor to place more adjacent border on the spot.
* Right click to release the focus of the box

## Example
Code Sample

```python
from PyQt5.QtWidgets import QWidget, QGridLayout, QApplication, QPushButton, QFileDialog

from pyqt_vbounding_box.vBoundingBox import VBoundingBox


class VBoundingBoxExample(QWidget):
    def __init__(self):
        super().__init__()
        self.__initUi()

    def __initUi(self):
        addImageBtn = QPushButton('Add image')
        addImageBtn.clicked.connect(self.__addImage)
        self.__view = VBoundingBox()

        lay = QGridLayout()
        lay.addWidget(addImageBtn)
        lay.addWidget(self.__view)

        self.setLayout(lay)

    def __addImage(self):
        filename = QFileDialog.getOpenFileName(self, 'Open', '', 'Image Files (*.png *.jpg *.bmp)')
        if filename[0]:
            filename = filename[0]
            self.__view.setFile(filename)


if __name__ == "__main__":
    import sys

    app = QApplication(sys.argv)
    ex = VBoundingBoxExample()
    ex.show()
    sys.exit(app.exec_())
```

Result

https://user-images.githubusercontent.com/55078043/157777737-a801f085-936e-4f08-95bc-9ae51313454a.mp4

## See Also
* <a href="https://github.com/yjg30737/pyqt-hbounding-box.git">pyqt-hbounding-box</a> - horizontal way
* <a href="https://github.com/yjg30737/pyqt-bounding-box.git">pyqt-bounding-box</a> - horizontal/vertical ways