/r/madeinpython

Photograph via snooOG

A subreddit for showcasing the things you made with the Python language! Use us instead of flooding r/Python :)

Hey check out r/madeinjs for JavaScript and Typescript!

A subreddit for showcasing the things you made with the Python language! Use us instead of flooding r/Python :)

/r/madeinpython

20,877 Subscribers

2

How to classify monkeys images using convolutional neural network , Keras tuner hyper parameters , and transfer learning ? (part3)

https://preview.redd.it/lns1uef39mzc1.png?width=1280&format=png&auto=webp&s=84ff0bf4e924795b01719bf15af110484d55c4d7

Video 3: Enhancing Classification with Keras Tuner:

🎯 Take your monkey species classification to the next level by leveraging the power of Keras Tuner.

So , how can we decide how many layers should we define ? how many filters in each convolutional layer ?

Should we use Dropout layer ? and what should be its value ?

Which learning rate value is better ? and more similar questions.

 

Optimize your CNN model's hyperparameters, fine-tune its performance, and achieve even higher accuracy.

Learn the potential of hyperparameter tuning and enhance the precision of your classification results.

 

This is the link for part 3: https://youtu.be/RHMLCK5UWyk&list=UULFTiWJJhaH6BviSWKLJUM9sg

 

I shared the a link to the Python code in the video description.

 

This tutorial is part no. 3 out of 5 parts full tutorial :

🎥 Image Classification Tutorial Series: Five Parts 🐵

In these five videos, we will guide you through the entire process of classifying monkey species in images. We begin by covering data preparation, where you'll learn how to download, explore, and preprocess the image data.

Next, we delve into the fundamentals of Convolutional Neural Networks (CNN) and demonstrate how to build, train, and evaluate a CNN model for accurate classification.

In the third video, we use Keras Tuner, optimizing hyperparameters to fine-tune your CNN model's performance. Moving on, we explore the power of pretrained models in the fourth video,

specifically focusing on fine-tuning a VGG16 model for superior classification accuracy.

Lastly, in the fifth video, we dive into the fascinating world of deep neural networks and visualize the outcome of their layers, providing valuable insights into the classification process

 

 

Enjoy

Eran

 

#Python #Cnn #TensorFlow #Deeplearning #basicsofcnnindeeplearning #cnnmachinelearningmodel #tensorflowconvolutionalneuralnetworktutorial

0 Comments
2024/05/10
15:19 UTC

2

Rock paper scissors game with score-python app built using tkinter

0 Comments
2024/05/10
11:18 UTC

1

AzuracastPy: An Unofficial Python Wrapper for the Azuracast API.

Source code

What My Project Does:

It acts as a wrapper for the AzuraCast API, providing custom functions and classes for more straightforward use of the API in python projects.

Target Audience:

Python users who are interested in programmatically interacting with online radios hosted on AzuraCast.

Comparison:

The idea of API Wrappers is not new. However, I noticed that the only existing wrapper for this API is written in PHP, which I am not experienced with. I created this project so I, and other python programmers by extension, could have an easier time working with the API.

This is my first "major" programming project, so thoughts and feedback are welcome and greatly appreciated.

PS: Shoutout to PRAW for "inspiring" basically everything about the project's structure and functionality.

0 Comments
2024/05/09
11:58 UTC

0

Which is the library or framework to build a high scale scraper?

I need to build scraper which will scrape news data from multiple news sites regularly? I need to build something like Google news

1 Comment
2024/05/09
05:08 UTC

2

InterProcessPyObjects: Fast IPC for Sharing and Modifying Objects Across Processes

InterProcessPyObjects Python package

github.com/FI-Mihej/InterProcessPyObjects

pypi.org/project/InterProcessPyObjects

What My Project Does

This high-performance package delivers blazing-fast inter-process communication through shared memory, enabling Python objects to be shared across processes with exceptional efficiency. By minimizing the need for frequent serialization-deserialization, it enhances overall speed and responsiveness. The package offers a comprehensive suite of functionalities designed to support a diverse array of Python types and facilitate asynchronous IPC, optimizing performance for demanding applications.

Target Audience

This project is designed for production environments, offering a stable API suitable for developers looking to implement fast inter-process communication. Whether you're building complex systems or require robust data sharing and modification across processes, InterProcessPyObjects is ready to meet your needs.

Comparison

Comparison with multiprocessing.shared_memory

While both InterProcessPyObjects and multiprocessing.shared_memory facilitate inter-process communication, there are several key differences to note. Unlike multiprocessing.shared_memory, InterProcessPyObjects offers the following enhancements:

  • High-Performance Mutable Objects: Both connected processes can modify shared objects at runtime, and these changes are immediately reflected on the other side. This feature not only increases flexibility but also delivers exceptional performance, with the capability to handle up to several million changes per second.
  • Synchronization Features: Ensures that operations are thread-safe and data integrity is maintained across processes.
  • Message Queue: Integrates a system for queuing messages, making communication between processes more structured and reliable.
  • Extended Type Support: Supports a broad range of data types, including custom classes, which goes beyond the basic types typically handled by multiprocessing.shared_memory.

These features make InterProcessPyObjects a more robust option for developers requiring advanced inter-process communication capabilities.

API State

Stable. Guaranteed not to have breaking changes in the future. (see github.com/FI-Mihej/InterProcessPyObjects?tab=readme-ov-file#api-state for details)

Key Features

  • Shared Memory Communication:

    • Enables sharing of Python objects directly between processes using shared memory.
    • Utilizes a linked list of global messages to inform connected processes about new shared objects.
  • Lock-Free Synchronization:

    • Uses memory barriers for efficient communication, avoiding slow syscalls.
    • Ensures each process can access and modify shared memory without contention.
  • Supported Python Types:

    • Handles various Python data structures including:
      • Basic types: None, bool, 64-bit int, large int (arbitrary precision integers), float, complex, bytes, bytearray, str.
      • Standard types: Decimal, slice, datetime, timedelta, timezone, date, time
      • Containers: tuple, list, classes inherited from: AbstractSet (frozenset), MutableSet (set), Mapping and MutableMapping (dict).
      • Pickable classes instancess: custom classes including dataclass
    • Allows mutable containers (lists, sets, mappings) to save basic types (None, bool, 64 bit int, float) internally, optimizing memory use and speed.
  • NumPy and Torch Support:

    • Supports numpy arrays by creating shared bytes objects coupled with independent arrays.
    • Supports torch tensors by coupling them with shared numpy arrays.
  • Custom Class Support:

    • Projects pickable custom classes instancess (including dataclasses) onto shared dictionaries in shared memory.
    • Modifies the class instance to override attribute access methods, managing data fields within the shared dictionary.
    • supports classes with or without __dict__ attr
    • supports classes with or without __slots__ attr
  • Asyncio Compatibility:

    • Provides a wrapper module for async-await functionality, integrating seamlessly with asyncio.
    • Ensures asynchronous operations work smoothly with the package's lock-free approach.

Main principles

  • only one process has access to the shared memory at the same time
  • working cycle:
    1. work on your tasks
    2. acacquire access to shared memory
    3. work with shared memory as fast as possible (read and/or update data structures in shared memory)
    4. release access to shared memory
    5. continue your work on other tasks
  • do not forget to manually destroy your shared objects when they are not needed already
  • feel free to not destroy your shared object if you need it for a whole run and/or do not care about the shared memory waste
  • data will not be preserved between Creator's sessions. Shared memory will be wiped just before Creator finished its work with a shared memory instance (Consumer's session will be finished already at this point)

Examples

Benchmarks

  • CPU: i5-3570@3.40GHz (Ivy Bridge)
  • RAM: 32 GBytes, DDR3, dual channel, 655 MHz
  • OS: Ubuntu 20.04.6 LTS under WSL2. Windows 10

Throughput GiB/s

Refference results (sysbench)

sysbench memory --memory-oper=write run
5499.28 MiB/sec

Benchmarks results table

Approachsync/asyncThroughput GiB/s
InterProcessPyObjects (sync)sync3.770
InterProcessPyObjects + uvloopasync3.222
InterProcessPyObjects + asyncioasync3.079
multiprocessing.shared_memory *sync2.685
uvloop.UnixDomainSocketsasync0.966
asyncio + cengal.Streamsasync0.942
uvloop.Streamsasync0.922
asyncio.Streamsasync0.784
asyncio.UnixDomainSocketsasync0.708
multiprocessing.Queuesync0.669
multiprocessing.Pipesync0.469

* multiprocessing.shared_memory.py - simple implementation. This is a simple implementation because it uses a similar approach to the one used in uvloop.*, asyncio.*, multiprocessing.Queue, and multiprocessing.Pipe benchmarking scripts. Similar implementations are expected to be used by the majority of projects.

Todo

  • Connect more than two processes
  • Use third-party fast hashing implementations instead of or in addition to built in hash() call
  • Continuous performance improvements

Conclusion

This Python package provides a robust solution for interprocess communication, supporting a variety of Python data structures, types, and third-party libraries. Its lock-free synchronization and asyncio compatibility make it an ideal choice for high-performance, concurrent execution.

Based on Cengal

This is a stand-alone package for a specific Cengal module. Package is designed to offer users the ability to install specific Cengal functionality without the burden of the library's full set of dependencies.

The core of this approach lies in our 'cengal-light' package, which houses both Python and compiled Cengal modules. The 'cengal' package itself serves as a lightweight shell, devoid of its own modules, but dependent on 'cengal-light[full]' for a complete Cengal library installation with all required dependencies.

An equivalent import:

from cengal.hardware.memory.shared_memory import *
from cengal.parallel_execution.asyncio.ashared_memory_manager import *

Cengal library can be installed by:

pip install cengal

https://github.com/FI-Mihej/Cengal

https://pypi.org/project/cengal/

Projects using Cengal

  • CengalPolyBuild - A Comprehensive and Hackable Build System for Multilingual Python Packages: Cython (including automatic conversion from Python to Cython), C/C++, Objective-C, Go, and Nim, with ongoing expansions to include additional languages. (Planned to be released soon)
  • cengal_app_dir_path_finder - A Python module offering a unified API for easy retrieval of OS-specific application directories, enhancing data management across Windows, Linux, and macOS
  • cengal_cpu_info - Extended, cached CPU info with consistent output format.
  • cengal_memory_barriers - Fast crossplatform memory barriers for Python.
  • flet_async - wrapper which makes Flet async and brings booth Cengal.coroutines and asyncio to Flet (Flutter based UI)
  • justpy_containers - wrapper around JustPy in order to bring more security and more production-needed features to JustPy (VueJS based UI)
  • Bensbach - decompiler from Unreal Engine 3 bytecode to a Lisp-like script and compiler back to Unreal Engine 3 bytecode. Made for a game modding purposes
  • Realistic-Damage-Model-mod-for-Long-War - Mod for both the original XCOM:EW and the mod Long War. Was made with a Bensbach, which was made with Cengal
  • SmartCATaloguer.com - TagDB based catalog of images (tags), music albums (genre tags) and apps (categories)

License

Licensed under the Apache License, Version 2.0.

1 Comment
2024/05/09
02:10 UTC

2

I made an image board using flask and imgbb api [ source code in comments ]

2 Comments
2024/05/06
14:32 UTC

3

I shared a 1+ hour Data Science Project on YouTube (Python - Pandas - Sk-learn - Streamlit)

Hello, I just shared a 1+ hour Data Science project on YouTube. I covered Data Analysis, Feature Engineering, Machine Learning and Web App creation in the video. I used Python, Pandas, Sk-learn and Streamlit. I also added the dataset link in the description. I am leaving the link below, have a great day!

https://www.youtube.com/watch?v=SJ_3_RlgAlU&list=PLTsu3dft3CWg69zbIVUQtFSRx_UV80OOg&index=3&t=2s

30+ Data Science Projects Playlist -> https://www.youtube.com/playlist?list=PLTsu3dft3CWg69zbIVUQtFSRx_UV80OOg

0 Comments
2024/04/28
14:04 UTC

1

How to classify monkeys images using convolutional neural network , Keras tuner hyper parameters , and transfer learning ? (part1)

https://preview.redd.it/xfak51iztrwc1.png?width=1280&format=png&auto=webp&s=fcd8a9f91db5d2af2b89898fa6d3cb2d364242d9

🎥 Image Classification Tutorial Series: Five Parts 🐵

In these five videos, we will guide you through the entire process of classifying monkey species in images. We begin by covering data preparation, where you'll learn how to download, explore, and preprocess the image data.

Next, we delve into the fundamentals of Convolutional Neural Networks (CNN) and demonstrate how to build, train, and evaluate a CNN model for accurate classification.

In the third video, we use Keras Tuner, optimizing hyperparameters to fine-tune your CNN model's performance. Moving on, we explore the power of pretrained models in the fourth video,

specifically focusing on fine-tuning a VGG16 model for superior classification accuracy.

Lastly, in the fifth video, we dive into the fascinating world of deep neural networks and visualize the outcome of their layers, providing valuable insights into the classification process

Video 1: Data Preparation Tutorial

In this tutorial we will download the dataset , make some data discovery , and prepare the images for the next phase of building the CNN model.

Link for the tutorial is here : https://youtu.be/ycEzhwiAXjY

Here is the code : https://github.com/feitgemel/TensorFlowProjects/tree/master/Monkey-Species

Enjoy

Eran

#Python #Cnn #TensorFlow #Deeplearning #basicsofcnnindeeplearning #cnnmachinelearningmodel #tensorflowconvolutionalneuralnetworktutorial

0 Comments
2024/04/26
06:52 UTC

3

In The Heart of Python Lives A Shell

DEMO: https://youtu.be/45JeIpDiJdc

A Shell DSL that transforms into Python.

I created this IDE to spin up Tkinter UIs or anything Python with less boilerplate and rich cognitive and efficiency shortcuts: for me, I think this tool helps me prototype GUI apps quicker with less characters typed so less effort.

I would love to take this further if I could get anyone interested. Thanks.

https://github.com/dislux-hapfyl/shimky

0 Comments
2024/04/25
20:16 UTC

1

Arganic - arguments and properties handler

Hi to all, I published yesterday my first open-source Python package named Arganic, it's a very small and lightweight library I'm using to manage *args and **kwargs arguments for classes, methods and functions, it's basically based on decorators, and make it easy to manage constraints and arguments validations. It's probably allready made by other libraries. I' m open to receive any suggestions or contributions to make it better. I don't know if it's very relevant, I stay open to any critics.

the full documentation

the Github project page

0 Comments
2024/04/25
08:15 UTC

2

ItsPrompt v1.5 - Prompting, the fancy way

Showcase of ItsPrompt

Hello r/madeinpython!

Prompting. We all need input from the user. No matter what kind of program you develop, making it interactive is important. But you do not need to care about the how.

With ItsPrompt you can ask the user for input in a few lines, without needing to care about the visuals, consistency and user experience - that is what ItsPrompt does for you!

Here you can view a GIF presenting the things ItsPrompt is capable of!

ItsPrompt can be found on PyPI and simply installed with pip:

pip install ItsPrompt

Unlike similar tools, ItsPrompt comes with many unique features, including:

  • Many different prompt types
  • Input Validation
  • Prompt styling
  • Prompt Completion

And much more!

With the update ItsPrompt v1.5, we finally have a detailed Documentation, hosted on readthedocs!

We also introduce more ways to customize your prompts and input data, like

The goal of ItsPrompt is to provide you an easy way of getting input from your users without spending your time on all the details, so you can focus on the important things of your program.

And if you want to help us make ItsPrompt even better, or you simply have questions, do not hesitate to visit our Github Project or to join our Discord!

And now, have fun with ItsPrompt!

0 Comments
2024/04/24
14:02 UTC

2

Sentiment Analysis Python App

Python app for analyzing single text and dataset using 2 popular libraries textblob and Vader sentiment

0 Comments
2024/04/24
13:24 UTC

0

Multi Agent Code Reviewer using GenAI

This tutorial explains how can Multi-Agent Orchestration be used to build an automatic code review system where a Coder and Reviewer go back & forth improving the code quality until all issues are resolved automatically: https://youtu.be/pdnT3yLk70c?si=TUrV50BlNu7UStoI

0 Comments
2024/04/22
09:53 UTC

2

Check out django-image-captcha, a sample application for eliminating bots from your forms.

Currently shows the use of image captcha.

Check it out here

0 Comments
2024/04/18
14:39 UTC

2

Issue

Using diffusion trends abd facing this output: No display found. Using non interactive Agg backend

0 Comments
2024/04/18
03:06 UTC

3

Tookie OSINT, an advanced social media tool.

Tookie OSINT is a social media tool that can find users social media profiles just with a username. Tookie is similar to the tool called Sherlock, but Tookie provides more features and options. Tookie is 80% accurate when discovering social media accounts. Tookie is 100% free and open source. Thanks for your time and I hope you check it out.

Alfredredbird/tookie-osint: Tookie is a advanced OSINT information gathering tool that finds social media accounts based on inputs. (github.com)

0 Comments
2024/04/17
23:12 UTC

Back To Top