Saravanan666/pypi-org huggingface dataset:
Package: colour-demosaicing
APythonpackage implementing various
CFA (Colour Filter Array) demosaicing algorithms and related utilities.It is open source and freely available under theBSD-3-Clauseterms.Table of Contents1Features1.1Examples2User Guide2.1Installation2.2Contributing2.3Bibliography3API Reference4Code of Conduct5Contact & Social6About1FeaturesThe following CFA (Colour Filter Array) demosaicing algorithms are implemented:BilinearMalvar (2004)DDFAPD - Menon (2007)1.1ExamplesVarious usage examples are available from theexamples directory.2User Guide2.1InstallationBecause of their size, the resources dependencies needed to run the various
examples and unit tests are not provided within the Pypi package. They are
separately available asGit Submoduleswhen cloning therepository.2.1.1Primary DependenciesColour - Demosaicingrequires various dependencies in order to run:python >= 3.9, < 4colour-science >= 4.3imageio >= 2, < 3numpy >= 1.22, < 2scipy >= 1.8, < 22.1.2PypiOnce the dependencies are satisfied,Colour - Demosaicingcan be installed from
thePython Package Indexby
issuing this command in a shell:pip install --user colour-demosaicingThe overall development dependencies are installed as follows:pip install --user 'colour-demosaicing[development]'2.2ContributingIf you would like to contribute toColour - Demosaicing,
please refer to the followingContributingguide forColour.2.3BibliographyThe bibliography is available in the repository inBibTeXformat.3API ReferenceThe main technical reference forColour - Demosaicingis theAPI Reference.4Code of ConductTheCode of Conduct, adapted from theContributor Covenant 1.4,
is available on theCode of Conductpage.5Contact & SocialTheColour Developerscan be reached via different means:EmailFacebookGithub DiscussionsGitterTwitter6AboutColour - Demosaicingby Colour DevelopersCopyright 2015 Colour Developers –colour-developers@colour-science.orgThis software is released under terms of BSD-3-Clause:https://opensource.org/licenses/BSD-3-Clausehttps://github.com/colour-science/colour-demosaicing
Package: coloured-logger
ColouredLoggercoloured-loggeris a Python package that provides a customised logger with coloured output and the ability to set verbosity levels dynamically.InstallationYou can install My Coloured Logger using pip:pipinstallcoloured-loggerUsageAs all the good loggers you simply use it as the standard loggerfromcoloured_loggerimportLoggerlogger=Logger(__name__)# Or any other name you wantlogger.info("This is an informational message.")logger.debug("This debug message won't be displayed.")Colour scheme is customisable by user using theANSI escape codesfor colours.
These are typically defined in terms of foreground and background colours, and each color has an associated numeric code. Here is a common mapping:Colour codesMost terminals support 8 and 16 colours, as well as 256 (8-bit) colours. These colours are set by the user, but have commonly defined meanings.8-16 ColoursColour NameForeground Colour CodeBackground Colour CodeBlack3040Red3141Green3242Yellow3343Blue3444Magenta3545Cyan3646White3747Default3949Reset00Note:theResetcolour is the reset code that resetsallcolours and text effects, UseDefaultcolour to reset colours only.Most terminals, apart from the basic set of 8 colors, also support the "bright" or "bold" colours. These have their own set of codes, mirroring the normal colours, but with an additional;1in their codes:# Set style to bold, red foreground.\x1b[1;31mHello# Set style to dimmed white foreground with red background.\x1b[2;37;41mWorldA simplified configurationThe user can simply define a python dictionary in order to change logger colours with a simplified colour scheme.Configure logger coloursIn order to configure the logger colours, the user can use the following codefromcoloured_loggerimportLoggermy_custom_colours={"WARNING":4,# Yellow background with blue text"INFO":2,# Green text"DEBUG":6,# Cyan text"CRITICAL":1,# Red text"ERROR":5# Magenta text}# This can change the logger levellogger_level="DEBUG"logger=Logger(__name__,my_custom_colours,logger_level)
Package: coloured-spectra
coloured_spectraGot a spectra? Use this to find the observed colour!Works great when applied to a single spectra. Using this for hyperspectral though... this Python implementation is too slow to be practical. (Can be magnitudes faster if coded in Julia)Documentation site:https://yiweimao.github.io/coloured_spectra/Blog post:https://yiweimao.github.io/blog/colour_of_spectra/Installpip install coloured-spectraExamplesFind the observed colour of a blackbody at 6500 K.fromcoloured_spectra.coloured_spectraimport*importnumpyasnpimportpickleimportmatplotlib.pyplotaspltimportcv2/Users/eway/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pandas/compat/__init__.py:97: UserWarning: Could not import the lzma module. Your installed Python is incomplete. Attempting to use lzma compression will result in a RuntimeError.
  warnings.warn(msg)bb=Blackbody(5778)bb.plot()defshow_blackbody_colour(T_K):bb=Blackbody(T_K,np.linspace(380,750))sRGB=spectra2sRGB(bb.λ_nm,bb.B_λT)# Due to normalisation choices, the brightness can change depending on the spectra# show the colour at max brightnessHSV=cv2.cvtColor(np.reshape(sRGB,(1,1,3)),cv2.COLOR_RGB2HSV_FULL)HSV[0,0,2]=255RGB=cv2.cvtColor(HSV,cv2.COLOR_HSV2RGB_FULL)plot_colour(RGB)This approximates the colour of the Sun with a blackbody temperature of 5778 K.show_blackbody_colour(5778)show_blackbody_colour(11000)# what about the star Rigel?If you have a hyperspectral line, you can colour it in by the observed colour. For this, the invisible UV and NIR is painted white on top of a black background. This look up table spectrum is:plot_hsv_LUT_spectrum()lines_nm=[254,436,546,764,405,365,578,750,738,697,812,772,912,801,842,795,706,826,852,727]# approx sorted by emission strengthimg=np.zeros((100,1000))wavelengths=np.linspace(350,850,1000)strength=1.forlineinlines_nm:indx=np.sum(wavelengths<line)ifindx>0andindx<1000:img[:,indx-2:indx+2]=strengthstrength-=0.05plt.imshow(img,cmap="gray",extent=[np.min(wavelengths),np.max(wavelengths),0,np.shape(img)[0]])plt.xlabel("wavelength (nm)")Text(0.5, 0, 'wavelength (nm)')You can see the emission lines have been coloured.colour_hyperspectral_line(wavelengths,img)100%|██████████| 100/100 [00:01<00:00, 57.32it/s]You can also return a column of observed colour given a hyperspectral line. It's just very slow.hyperspec_line2colour(wavelengths,img)100%|██████████| 100/100 [00:03<00:00, 31.57it/s]You may want to colour in a band of a multispectral or hyperspectral datacube according to the central wavelength.
Package: colourettu
Colourettu is a small collection of colour functions in Python. These can be used to determine the (relative) luminosity of a colour and the contrast between two colours. There is also the palette class for dealing with a ‘list’ of colours.Installationpip install colourettuDocumentationFull documentation is available athttp://minchin.ca/colourettu/ChangelogFull changelog is available athttp://minchin.ca/colourettu/changelog.htmlLinksCode, on GitHub:http://www.github.com/minchinweb/colourettu/Report a Bug!https://github.com/minchinweb/colourettu/issuesDocumentation:http://minchin.ca/colourettu/Listing on PyPI:https://pypi.python.org/pypi/colourettuLicenseColourettuis licensed under the MIT license.
Package: colour-filter
colour_filter module and colour-filter command - colour parts of linescolour-filter commandThecolour-filtercommand reads lines from its input,
colours parts of the line and prints the result on its output.For example colour the output of a build script. ColourInfo:in green
and all of the line that startsError:in red.$./build.sh2>&1|colour-filter'^Info:'green'Error:.*'redcolour_filter moduleColourFilterclass__init__()Create instance of ColourFilter.enableDebug( enable=True )Turn on the debug output to help understand why patterns are not matching as expected.define( pattern, colour )When the regular expresspatternis found in a line of input colour it ascolouron the output.colouris either the string name of a list colour name seperated by ':' or ';'.
E.g.'red'or 'red;bg-white'The builtin foreground colour names are:bold, black, brown, green, yellow, blue,
  magenta, cyan, gray, red, lightred, lightgreen,
  lightyellow, lightblue, lightmagenta, lightcyan
  ans white.The builtin background colour names are:bg-black, bg-brown, bg-green, bg-yellow,
  bg-blue, bg-magenta, bg-cyan, bg-gray
  and bg-white.filterLines( input_file, output_file, line_buffered )Read lines frominput_fileuntil end-of-file.
Replace all matching patterns with their defined colour.
Write each converted line tooutput_fileand ifline_bufferedisTruecallflush()on theoutput_file.Example that colours lines ofbuild.logfromcolour_filterimportColourFilterf=ColourFilter()f.define('Info:','green')f.define('Error:','red;bg-white')withopen('build.log')asinput_file:f.filterLines(input_file,sys.stdout,line_buffered=False)
Package: colourful
colourfulcolourful is a package to colorize any greyscale image.UsagefromcolourfulimportColourapi=Colour("your-api-key")image=api.colourize("path/to/file/or/url")print(image)ExamplefromcolourfulimportColourapi=Colour("api-key")image_url=api.colourize("https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcSquKY_mSuJBAAiJ96LPdqS3yWFLMqZSvL73g&usqp=CAU")print(image_url)>https://api.deepai.org/job-view-file/8ef87b60-aecc-4ac4-8e8b-cc4de7a107eb/outputs/output.jpgExample Using ImagesInput -Output -Get API Key1 - Go toDeepAIand create an account2 - Verify by clicking on the URL sent by DeepAI to your E-Mail3 - Go toDeepAI Dashboardand get your API KeyNote - This package is currently under development
Package: colourful-console
Colourful ConsoleIntroductionA simple python package to print colors in terminal using simple markup syntaxInstallationpip install colourful-consoleBasic Usageimportcolourful_consoleasconsoleconsole.init()text='What is your <b>name</b> :'name=console.read_line(text)console.clear()console.write_line(f'Your name is <g>{name}</g>')console.title('Press enter to exit..')input()More on titlesimportcolourful_consoleasconsole# to set a simple titleconsole.title('This is a simple title')# to set a title with multiple dynamic dataconsole.set_title(lang='python',version=3,foo='bar')# Please note, when the python program exits# then the custom title will also vanish and# be replaced with the previous title# that was before running the python programTodoAdd more colorsAdd uniqe textstyling like underline, bold, strikethroughAdd custom styles for specifi platform and command line appsNoteThe terminal in unix and max are much more capable and better to show colors than window's cmd and powershell.Microsoft released a new terminal which is as capable to show colors like unix/mac terminals namedterminalonMicrosoft store, you can use that terminal to show fancy styles in window platform
Package: colourgan
ColourGANSimple PyTorch based GAN for colouring black and white images.InstallationThe code is available as python package.Run following command for installing colourgan with all it's dependencies.pipinstallcolourganAdditionally for trying out streamlit interface, please install streamlit using following commandpipinstallstreamlitYou can also install it from this repository.gitclonehttps://github.com/narenderkumarnain/ColourGAN.gitcdColourGAN
pythonsetup.pyinstallUsageInferenceFor trying our pretrained model, please download theGenerator Weight FileNow use these lines of code for inference on sample image.#importsimportcv2fromcolourgan.modelimportColourGANfromcolourgan.configimportget_cfg# preparing the configcfg=get_cfg()# adding path to generator weightscfg.initial_weights_generator='checkpoint_ep99_gen.pt'# loading the modelmodel=ColourGAN(cfg,inference=True)# loading the imageimg=cv2.imread('sample.png')# running inferenceres=model.inference(img)# saving result imagecv2.imwrite('sample_res.png',res)Streamlit interfaceFor trying out the streamlit interface, create a file app.py with following code.# importfromcolourgan.streamlitimportapp# path to weights filepath_to_generator_weights='checkpoint_ep99_gen.pt'if__name__=='__main__':app(path_to_generator_weights)We expect you have already installed streamlit.Use followind code to run the applicationstreamlitrunapp.pyTrainingUse following Lines of code for training the model on Cifar10 dataset.# importsimporttorchfromcolourgan.configimportget_cfgfromcolourgan.dataimportCifar10Datasetfromcolourgan.modelimportColourGAN# Downloading the data and creating the dataloadersdataloaders=Cifar10Dataset('cifar10',batch_size=8).get_dataloaders()# configcfg=get_cfg()# creating the modelmodel=ColourGAN(cfg)# trainmodel.train(dataloaders['train'],dataloaders['test'],epochs=100)Pretrained WeightsGeneratorDiscriminatorReferencesGAN_image_colorizingColorizing-with-GANs
Package: colour-hdri
APythonpackage implementing various
HDRI processing algorithms.It is open source and freely available under theBSD-3-Clauseterms.Table of Contents1Features1.1Examples2User Guide2.1Installation2.2Contributing2.3Bibliography3API Reference4See Also4.1Publications4.2Software5Code of Conduct6Contact & Social7About1FeaturesThe following features are available:HDRI GenerationDebevec (1997) Camera Response Function ComputationGrossberg (2003) Histogram Based Image SamplingVariance Minimization Light Probe SamplingGlobal Tonemapping OperatorsAdobe DNG SDK Colour ProcessingAbsolute Luminance CalibrationDigital Still Camera (DSC) Exposure ModelRaw Processing HelpersVignette Characterisation & Correction1.1ExamplesVarious usage examples are available from theexamples directory.2User Guide2.1InstallationBecause of their size, the resources dependencies needed to run the various
examples and unit tests are not provided within the Pypi package. They are
separately available asGit Submoduleswhen cloning therepository.2.1.1Primary DependenciesColour - HDRIrequires various dependencies in order to run:python >= 3.9, < 4colour-science >= 4.3imageio >= 2, < 3numpy >= 1.22, < 2scipy >= 1.8, < 22.1.2Optional Features Dependenciescolour-demosaicingAdobe DNG ConverterdcrawExifToolrawpy2.1.3PypiOnce the dependencies are satisfied,Colour - HDRIcan be installed from
thePython Package Indexby
issuing this command in a shell:pip install --user colour-hdriThe optional features dependencies are installed as follows:pip install --user 'colour-hdri[optional]'The figures plotting dependencies are installed as follows:pip install --user 'colour-hdri[plotting]'The overall development dependencies are installed as follows:pip install --user 'colour-hdri[development]'2.2ContributingIf you would like to contribute toColour - HDRI,
please refer to the followingContributingguide forColour.2.3BibliographyThe bibliography is available in the repository inBibTeXformat.3API ReferenceThe main technical reference forColour - HDRIis theAPI Reference.4See Also4.1PublicationsAdvanced High Dynamic Range Imaging: Theory and Practiceby Banterle, F. et al.Advanced High Dynamic Range Imaging: Theory and Practicewas used as a
reference for some of the algorithms ofColour - HDRI.4.2SoftwareC/C++OpenCVby Bradski, G.Piccanteby Banterle, F. and Benedetti, L.,Piccantewas used to verify the Grossberg (2003) Histogram Based Image Sampling.MatlabHDR Toolboxby Banterle, F. et al.5Code of ConductTheCode of Conduct, adapted from theContributor Covenant 1.4,
is available on theCode of Conductpage.6Contact & SocialTheColour Developerscan be reached via different means:EmailFacebookGithub DiscussionsGitterTwitter7AboutColour - HDRIby Colour DevelopersCopyright 2015 Colour Developers –colour-developers@colour-science.orgThis software is released under terms of BSD-3-Clause:https://opensource.org/licenses/BSD-3-Clausehttps://github.com/colour-science/colour-hdri
Package: colourmap
colourmap*Colourmapgenerates an unique lit of RGB and HEX colors for the specified input list.⭐️ Star this repo if you like it ⭐️Documentation pagesOn thedocumentation pagesyou can find more information aboutcolourmapwith examples.Install colourmap from PyPIpipinstallcolourmap# normal installpipinstall-Ucolourmap# update if neededImport colourmap packagefromcolourmapimportcolourmapQuick exampleUse the documentation pages for more detailed usage. Some of the most used functionalities are linked below.fromcolourmapimportcolourmap# Create N colorsc=colourmap.generate(10)# From listc_rgb,c_dict=colourmap.fromlist([1,1,2,2,3,1,2,3])# to HEXc_hex=colourmap.rgb2hex(c_rgb)Example: Generate N unique colors from a specific colormapExample: Generate unique colors based on input labelsExample: Create unique colors based on seaborn or matplotlibExample: Conversion RGB to HEXExample: Conversion HEX to RGBExample: Create a linear gradient between colorsMaintainerErdogan Taskesen, github:erdogantContributions are welcome.For citations, please use the citation at the right side panel.If you wish to buy me aCoffeefor this work, it is very appreciated :)
Package: colourout
colouroutA Python package for printing coloured text to the terminal.InstallationInstall this package using pip:pip install colouroutAPIThecolouroutpackage provides two functions, and anEnumfor the available colours.printcTheprintcutilises the builtinprintfunction to print coloured text to the terminal.fromcolouroutimportprintcprintc("Hello, World!",styles=["BLUE","UNDERLINE"])>>>\033[34m\033[4mHello,World!\033[0meprintcTheeprintcfunction is the same asprintc, but prints tostderrinstead ofstdout.fromcolouroutimporteprintceprintc("Hello, World!",styles=["RED","BOLD"])>>>\033[31m\033[1mHello,World!\033[0mStylesTheStylesenum provides a list of available styles.fromcolouroutimportStyles,printcprintc("Hello, World!",styles=[Styles.BLUE,Styles.UNDERLINE],)>>>\033[34m\033[4mHello,World!\033[0mContributingFork the repository and clone it locally.Make any changes you want and then submit a pull request.Ensure all tests are passing and that you have added tests for any new functionality.Run testing, formatting, and linting by usingnox.You can run individual sessions by using the-sflag with nox.
For example:nox -s test
nox -s lintCode is formatted and linted upon commit using thepre-committool.Make sure to install thepre-commitconfig usingpre-commit installonce you have installed therequirements-dev.txtdependencies.You can check that everything is passing by runningpre-commitaftergit add-ing your files to a commit.NOTE:Tests are not run withpre-commitdue to performance issues, please ensure to runnoxto validate tests.AuthorsSam Kenney -Initial release-sam-kenneyLicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for details
Package: colourpy
pyColourA python function file that colours output strings.ContentsUsageCommandsBasic ColoursBright VariantsOther Formatting256 Colour SupportHighlightingNoteUsageInstall withpip install colourpyCall the file into your python project with:frompyColourimport*Use the following commands in your code.
Text colour, background colour and formatting can be used at the same time, by stacking (e.g. `bold(red(bgGreen("Hello world!"))))NOTE: the outermost colour is the colour that the text will be displayed as (e.g. inyellow(red(green("hello")))), "hello" will be displayed in yellow.CommandsBasic Colourscolourcommandblackblack(string)redred(string)greengreen(string)yellowyellow(string)blueblue(string)magentamagenta(string)whitewhite(string)Bright Variantscolourcommandbright black (grey 1)bright_black(string)bright redbright_red(string)bright greenbright_green(string)bright yellowbright_yellow(string)bright bluebright_blue(string)bright magentabright_magenta(string)bright white (grey 2)bright_white(string)Other FormattingFormatCommandBoldbold(string)Underlineunderline(string)Reversereverse(string)256 Colour supportFor custom colours, use the following command:colour_256(string, [0 -> 255])HighlightingHighlighting is also possible, and you can use the same commands as before, just withbginfront of it (i.e.bgBlue(string),bgBright_magenta(string))NoteThis project is loosely based on the idea of Simple Chalk.EditsDateEdit DescriptionVersion27/03/22Edits to README.md0.1.0
Package: colour-sort
Colour SortGenerating Images using all 2563RGB colours, inspired byhttps://allrgb.com/TechniqueTo generate a re-coloured image, the source image's pixel data is sorted (using one of several different sorting modes) using numpy'sargsortfunction, giving us a mapping from the original to the sorted version. This mapping is then used to "unsort" an array of all 2563colours that in sorted order. The result of this operation is then written out as our result.InstallingGo getpoetry.$ poetry installRunningOnce the tool has been installed, it can be ran with the following command$ colour generate --help
usage: colour generate [-h] [--sort {brightness,avg,rgb,rbg,brg,bgr,grb,gbr}]
                       infile outfile

positional arguments:
  infile
  outfile

optional arguments:
  -h, --help            show this help message and exit
  --sort {brightness,avg,rgb,rbg,brg,bgr,grb,gbr}

$ colour verify --help
usage: colour verify [-h] infile

positional arguments:
  infile

optional arguments:
  -h, --help  show this help message and exit
Package: colourspace
ColourspaceColourspaceis a Python library and viewer tool used to render videos and
images in the proper colourspace using thecolorspaceFFmpegfilter.It uses theavpackage to accessFFmpegfunctionality, andpymediainfoto obtain file and stream metadata, that is not yet available throughav(even though itisavailable inFFmpeg).Note:PyAVuses a (rather) outdated version of FFmpeg: 5.1.2, which may lack bug fixes
and support for newer functionality. Check theFFmpeg build scriptfor PyAV.LicenseLicensed under BSD 3-Clause.CopyrightCopyright (C) 2023, Svetlin Ankov, Simona Dimitrova
Package: colour-splash
Colour SplashA simple tool enabling easy colouring of terminal outputsDownloadUsing PIP to use a imported Modulepip install colour_splashManually to embed into a projectgit clone https://github.com/lachlan2357/python-colour-splashinto your project directoryUsageIncludeimport colour_splashat the top of your fileExamplesRed text colour with white backgroundcolour_splash.colour("this is red text with a white background", "red", "white")orcolour_splash.colour("this is red text with a white background", colour_splash.colours.red, colour_splash.colours.white)Only white backgroundcolour_splash.colour("this is text with a white background", background = "white")orcolour_splash.colour("this is text with a white background", background = colour_splash.colours.white)Dim textcolour_splash.colour("this is dim text", "dim")orcolour_splash.colour("this is dim text", colour_splash.styles.dim)Functionscolour_splash.colour()Changes the foreground, background or both-grounds of textParameters:textthe text you wish to be colouredforeground(optional): the string/colours value of the name of the colour you wish to use as the foreground (text) colourbackground(optional): the string/colours value of the name of the colour you wish to use as the background (highlighted) colourcolour_splash.style()Changes the style of textParameters:text: the text you wish to be styledstyle(optional): the string/styles value of the name of the style you wish to usecolour_splash.colour_start()Starts a specific colour for all proceeding textParameters:foreground(optional): the string/colours value of the name of the colour you wish to use as the foreground (text) colourbackground(optional): the string/colours value of the name of the colour you wish to use as the background (highlighted) colourcolour_splash.style_start()Starts a specific style for all proceeding textParameters:style(optional): the string/styles value of the name of the style you wish to usecolour_splash.colour_end()Returns the proceeding text to its previous colour/stylecolour_splash.style_end()Returns the proceeding text to its previous colour/stylecolour_splash.help()Lists colours and styles and how they appear on your system