A simple API wrapper for Discord interactions.

Overview
discord-py-interactions

Your ultimate Discord interactions library for discord.py.

About | Installation | Examples | Discord | PyPI

About

What is discord-py-interactions?

discord-py-interactions is, in the simplest terms, a library extension that builds off of the currently existing discord.py API wrapper. While we do use our own basic class code for our own library, a large majority of this library uses discord.py base events in order to make contextualization of interactions relatively easy for us.

When did this begin?

In mid-December of 2020, Discord released the very first type of components, slash commands. These were relatively primitive at the time of their debut, however, over time they slowly came to grew more complex and mutable. This library was created 2 days after the release of slash commands to Discord, and ever since has been actively growing.

What do we currently support?

At this time, we are able to provide you an non-exhaustive list (because Discord are actively creating more interactions at this time) of all components integrated as interactions:

  • Slash Commands
  • Buttons
  • Selects (also known as dropdowns or menus)

Installation

We recommend using pip in order to install our library. You are able to do this by typing the following line below:

pip install -U discord-py-interactions

Examples

Slash Commands

This example shows a very quick and simplistic solution to implementing a slash command.

from discord import Client, Intents, Embed
from discord_slash import SlashCommand, SlashContext

bot = Client(intents=Intents.default())
slash = SlashCommand(bot)

@slash.slash(name="test")
async def test(ctx: SlashContext):
    embed = Embed(title="Embed Test")
    await ctx.send(embed=embed)

bot.run("discord_token")

Cogs

This example serves as an alternative method for using slash commands in a cog instead.

# bot.py
from discord import Intents
from discord.ext.commands import Bot
from discord_slash import SlashCommand

# Note that command_prefix is a required but essentially unused paramater.
# Setting help_command=False ensures that discord.py does not create a !help command.
# Enabling self_bot ensures that the bot does not try and parse messages that start with "!".
bot = Bot(command_prefix="!", self_bot=True, help_command=False, intents=Intents.default())
slash = SlashCommand(bot)

bot.load_extension("cog")
bot.run("discord_token")

# cog.py
from discord import Embed
from discord.ext.commands import Bot, Cog
from discord_slash import cog_ext, SlashContext

class Slash(Cog):
    def __init__(self, bot: Bot):
        self.bot = bot

    @cog_ext.cog_slash(name="test")
    async def _test(self, ctx: SlashContext):
        embed = Embed(title="Embed Test")
        await ctx.send(embed=embed)

def setup(bot: Bot):
    bot.add_cog(Slash(bot))

Buttons

This basic example shows how to easily integrate buttons into your commands. Buttons are not limited to slash commands and may be used in regular discord.py commands as well.

from discord_slash.utils.manage_components import create_button, create_actionrow
from discord_slash.model import ButtonStyle

buttons = [
    create_button(style=ButtonStyle.green, label="A green button"),
    create_button(style=ButtonStyle.blue, label="A blue button")
]
action_row = create_actionrow(*buttons)

await ctx.send(components=[action_row])

Advanced

For more advanced use, please refer to our official documentation on buttons here.

Selects

This basic example shows how to add selects into our bot. Selects offer the same accessibility as buttons do in premise of limitations.

from discord_slash.utils.manage_components import create_select, create_select_option, create_actionrow

select = create_select(
    options=[
        create_select_option("Lab Coat", value="coat", emoji="🥼"),
        create_select_option("Test Tube", value="tube", emoji="🧪"),
        create_select_option("Petri Dish", value="dish", emoji="🧫")
    ],
    placeholder="Choose your option",
    min_values=1, # the minimum number of options a user must select
    max_values=2 # the maximum number of options a user can select
)
action_row = create_actionrow(select)

await ctx.send(components=[action_row])

Advanced

For more advanced use, please refer to our official documentation on selects here.

Context Menus

This basic example shows how to add a message context menu.

from discord_slash.context import MenuContext
from discord_slash.model import ContextMenuType

@slash.context_menu(target=ContextMenuType.MESSAGE,
                    name="commandname",
                    guild_ids=[789032594456576001])
async def commandname(ctx: MenuContext):
    await ctx.send(
        content=f"Responded! The content of the message targeted: {ctx.target_message.content}",
        hidden=True
    )

Advanced

For more advanced use, please refer to our official documentation on context menus here.


Comments
  • [BUG] TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

    [BUG] TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

    Describe the bug message should delete but cannot find id of message Reproducing steps These are the steps I took in order to produce this bug, which should be able to be reproduced for everyone else as well.

    1. Import the module in Python.
    2. Create a client variable for the library.
    3. Try creating a slash command.
    4. send a message
    5. Delete the message
    6. See the traceback error given in the terminal or logger file.

    What's normally expected The message should be deleted

    What actually happened Instead, I received this traceback error given from my Python terminal:

    Traceback (most recent call last):
      File "/root/inter/main.py", line 233, in buy
        await n.delete()
      File "/usr/local/lib/python3.8/dist-packages/interactions/api/models/message.py", line 335, in delete
        message_id=int(self.id), channel_id=int(self.channel_id), reason=reason
    TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
    

    code: https://pastebin.com/qfJU76TF Versions newest unstable wait_for

    bug 
    opened by dontbanmeplz 31
  • refactor: split `_dispatch_event` in two methods

    refactor: split `_dispatch_event` in two methods

    About

    This pull request splits _dispatch_event in two other methods.

    Checklist

    • [x] I've ran pre-commit to format and lint the change(s) made.
    • [x] I've checked to make sure the change(s) work on 3.8.6 and higher.
    • [ ] This fixes/solves an Issue (If existent):.
      • resolves #
    • I've made this pull request for/as: (check all that apply)
      • [x] Documentation
      • [ ] Breaking change
      • [x] New feature/enhancement
      • [ ] Bugfix
    opened by Damego 21
  • Weird issue.

    Weird issue.

    Why am I getting this issue?

    Traceback (most recent call last):
      File "C:\Users\Thomas Keig\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\discord\client.py", line 333, in _run_event
        await coro(*args, **kwargs)
      File "C:\Users\Thomas Keig\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\discord_slash\client.py", line 344, in on_socket_response
        await selected_cmd["func"](ctx, *args)
      File "G:/My Drive/Home/Python Projects/Personal/iFBR Bot/Discord Bot/v2.0/bot (only slash cmds).py", line 547, in export
        await ctx.send(embeds=[embed2])
      File "C:\Users\Thomas Keig\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\discord_slash\model.py", line 111, in send
        resp = await self._http.post(base, self._discord.user.id, self.interaction_id, self.__token, initial)
      File "C:\Users\Thomas Keig\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\discord_slash\http.py", line 34, in post
        raise RequestFailure(resp.status, await resp.text())
    discord_slash.error.RequestFailure: Request failed with resp: 404 | {"message": "Unknown interaction", "code": 10062}
    
    help wanted 
    opened by thomaskeig 21
  • [REQUEST] Limiting cache

    [REQUEST] Limiting cache

    What is the feature you're proposing? As of right now, caching has no limit. I feel like there should be a way to set a limit for each type of cache, preferably in the Client instance.

    Something like:

    bot = interactions.Client(
        ...,
        cache_limits=interactions.CacheLimits(
            messages=100,
            guilds=50,
            ...
        )
    )
    

    This is the best thing that I can think of off the top of my head. Another way is to ~~do what dis-snek did~~ do something with kwargs and have something like this:

    bot = interactions.Client(
        ...,
        message_cache=100,
        guild_cache=50,
        ...
    )
    

    Additional Information

    • [ ] My feature request is related to an existing Issue.
      • Issue (if referenceable):
    documentation enhancement 
    opened by Toricane 19
  • feat: create basic functionality for Extensions

    feat: create basic functionality for Extensions

    Expands Extension.new and adds new functions to mimic client decorators

    About

    This pr adds in basic functionality for the Extension class, along with decorators for commands/components/listeners Marked as a draft because some things are missing, like properly removing commands on removal of the Extension Any suggestions on improvements are welcome

    Checklist

    • [ ] I've ran pre-commit to format and lint the change(s) made.
    • [x] I've checked to make sure the change(s) work on 3.8.6 and higher.
    • [x] This fixes/solves an Issue.
    • [x] I've made this pull request for/as: (check all that apply)
      • [ ] Documentation
      • [ ] Breaking change
      • [x] New feature/enhancement
      • [ ] Bugfix
    documentation enhancement pending breaking priority 
    opened by Catalyst4222 19
  • Slash command greyed out even though I have permission

    Slash command greyed out even though I have permission

    I created a simple bot with this module, and I believe this is a bug. I was working with this bot, everything working normally, when suddenly my permission based commands were greyed out. I can't pinpoint the exact change that caused the issue, but it happened when I added a command I think. I'm still in the process of debugging, but believe this is a bug. What I have tried:

    • [x] Deleting the commands
    • [x] Unloading the cog
    • [x] Deleting all slash commands
    • [x] Restarting the bot
    • [x] Using a different bot

    Let me know if I should try any new debugging steps

    opened by zurgeg 19
  • Add Application Permissions Support

    Add Application Permissions Support

    About this pull request

    Adds support for the slash command permissions. I wanted it for my own bot, got it into a workable state, so I figure I can open a PR to add its feature for everyone if accepted. Feel free to review and test. Let me know of any feedback, happy to accept critics and improve the code 😄.

    Changes

    • Add setting of default_permission and permissions option for slash command.
    • Add get_all_command_permissions and put_command_permissions method to http module.
    • Add support for storing permission data in CommandObject.
    • Add create_guild_permissions and create_permission utils method to facility defining permissions.
    • Add PermissionsData class used for checking for any permission updates since last sync, similar to how CommandData works.
    • Add logic to registers permissions in the sync_all_commands method.
    • Add SlashCommandPermissionsType enum class to match discord api's ApplicationCommandPermissionType.
    • Add relevant documentation needed for the code changes.

    Example decorator with subcommand:

    @slash.subcommand(
        guild_ids=[750556940127436880, 823454213089787914],
        base="test", 
        base_desc="test",  
        subcommand_group="group",
        sub_group_desc="group",
        name="sub",
        description="sub"
    )
    @slash.permission(823454213089787914, generate_permissions(allowed_roles=[823851472982376468, 823851440232857600]))
    @slash.permission(750556940127436880, generate_permissions(allowed_roles=[778838673666998292]))
    async def test_sub(ctx):
        await ctx.send("test_sub")
    

    Checklist

    • [ ] I've checked this pull request runs on Python 3.6.X.
    • [ ] This fixes something in Issues.
      • Issue:
    • [x] This adds something new.
    • [x] There is/are breaking change(s).
    • [x] (If required) Relevant documentation has been updated/added.
    • [ ] This is not a code change. (README, docs, etc.)
    enhancement priority 
    opened by benwoo1110 17
  • Auto delete could potentially make a lot of requests

    Auto delete could potentially make a lot of requests

    The Problem

    Currently if auto_delete is True a GET request will be made for every guild the bot is in on every load. This could potentially cause thousands of requests (depending on the size of the bot) and discord has indicated that they might be introducing rate limits for slash commands. This could make the library unusable for some.

    Proposed solution

    Add a check_all_guilds parameter to SlashCommand which defaults to False. If it's false then check all guilds that have commands registered to them, don't check all guilds. If it's true check all guilds (like currently), possibly add a WARNING if guilds above a certain number.

    The only problem I can see with this is that it won't delete commands in a guild if there are no commands registered to that guild in SlashCommand

    Possible alternatives

    • Proposed solution above but default to False
    • Proposed solution above but require it
    • Leave it as is, causing high traffic at startup for large bots, and possibly reaching rate limits
    • The ideal solution would be an endpoint that could be used to get all guilds with commands currently. There's an issue on the discord repo but no one has responded yet
    help wanted 
    opened by AnotherCat 15
  • refactor!: use `attrs.asdict` as a way to get json data of the object

    refactor!: use `attrs.asdict` as a way to get json data of the object

    About

    This pull request:

    1. Makes DictSerializerMixin._json as a property with using attrs.asdict to get json data of the object.
    2. Solves all troubles with editing json. You don't need to edit json anymore lol.
    3. Removes ComponentMixin and json modifing in a lot of objects like Embed.
    4. Limited using _json property in some places: using walrus operators and objects instead of dicts(wsclient).
    5. Removes outdated(since attrs added) code like here

    Checklist

    • [x] The pre-commit code linter has been run over all edited files to ensure the code is linted.
    • [x] I've ensured the change(s) work on 3.8.6 and higher.

    I've made this pull request: (check all that apply)

    • [ ] For the documentation
    • [ ] To add a new feature
    • [x] As a general enhancement
    • [x] As a refactor of the library/the library's code
    • [ ] To fix an existing bug
    • [ ] To resolve #ISSUENUMBER

    This is:

    • [x] A breaking change
    enhancement 
    opened by Damego 14
  • fix!: fix ``guilds`` property in client

    fix!: fix ``guilds`` property in client

    About

    Fixes an error occurring because of the cached guild object already having an HTTPClient

    Checklist

    • [x] I've ran pre-commit to format and lint the change(s) made.
    • [x] I've checked to make sure the change(s) work on 3.8.6 and higher.
    • [x] This fixes/solves an Issue.
      • (If existent): #664
    • [ ] I've made this pull request for/as: (check all that apply)
      • [ ] Documentation
      • [ ] Breaking change
      • [ ] New feature/enhancement
      • [x] Bugfix
    opened by EdVraz 12
  • Heartbeat dropping crashes the bot until manually restarted

    Heartbeat dropping crashes the bot until manually restarted

    This has been discussed in the Discord server, but I thought I'd file an issue for the sake of completeness.

    When a bot can't get a heartbeat, there's no connection logic to reconnect the bot afterwards. This means that bots, even on stable connections (I'm using a Contabo VPS), can have trouble staying online for any extended period of time.

    For now, as a bodge, I'm testing using GNU timeout to restart my bot by force as a pre-emptive measure - if anyone wants the shell script, let me know

    bug 
    opened by dxf 12
  • [BUG] Error starting when using scope param in command decorator

    [BUG] Error starting when using scope param in command decorator

    Describe the bug.

    When starting the bot with a command that has a scope as a param specified it results in a KeyError:

    Could not prepare the client:
    Traceback (most recent call last):
      File "----/venv/lib/python3.10/site-packages/interactions/client/bot.py", line 404, in _ready
        await self.__sync()
      File "----/venv/lib/python3.10/site-packages/interactions/client/bot.py", line 621, in __sync
        if _guild_command["name"] not in __check_guild_commands[_guild_id]:
    KeyError: None
    

    List the steps.

    1. Create a bot:
    ids = 8210301307------
    bot = interactions.Client(token="", default_scope=ids)
    
    1. Create a command with a scope param:
    @bot.command(
        name="test",
        description="test",
        scope=ids
    )
    async def _test(ctx):
        await ctx.send("test")
    
    
    1. run the bot
    2. see Traceback

    What you expected.

    The command should be correctly registered for the guilds provided in the default_scope and command scope

    File client/bot.py, line 517, in __resolve_commands:

    if cmd.default_scope and self._default_scope:
        cmd.scope = (
            cmd.scope.extend(self._default_scope)
            if isinstance(cmd.scope, list)
            else self._default_scope
        )
    

    cmd.scope.extend(self._default_scope) extends the cmd.scope, but then sets cmd.scope to its return value, which is None. This overrides the scope, resulting in None being passed as the scope to command in full_data. This passes None as the guild_id to the ApplicationCommand, which is used in when getting a guild_commands _guild_id => KeyError here if _guild_command["name"] not in __check_guild_commands[_guild_id]:

    replace

    if cmd.default_scope and self._default_scope:
      cmd.scope = (
          cmd.scope.extend(self._default_scope)
          if isinstance(cmd.scope, list)
          else self._default_scope
      )
    

    with

    if cmd.default_scope and self._default_scope:
      if isinstance(cmd.scope, list):
        cmd.scope.extend(self._default_scope)
      else:
        cmd.scope = self._default_scope
    

    What you saw.

    Instead, I received this traceback error given from my Python terminal:

    Could not prepare the client:
    Traceback (most recent call last):
      File "----/venv/lib/python3.10/site-packages/interactions/client/bot.py", line 404, in _ready
        await self.__sync()
      File "----/venv/lib/python3.10/site-packages/interactions/client/bot.py", line 621, in __sync
        if _guild_command["name"] not in __check_guild_commands[_guild_id]:
    KeyError: None
    

    What version of the library did you use?

    stable

    Version specification

    4.3.4

    Code of Conduct

    • [X] I agree to follow the contribution requirements.
    bug 
    opened by H3rmt 1
  • fix(attrs): add factory value to interaction resolved data

    fix(attrs): add factory value to interaction resolved data

    About

    This pull request fixes error from this thread Tested locally:

    from interactions import InteractionResolvedData
    
    data = InteractionResolvedData()
    print("a" in data.members)
    

    Checklist

    • [ ] The pre-commit code linter has been run over all edited files to ensure the code is linted.
    • [ ] I've ensured the change(s) work on 3.8.6 and higher.

    I've made this pull request: (check all that apply)

    • [ ] For the documentation
    • [ ] To add a new feature
    • [ ] As a general enhancement
    • [ ] As a refactor of the library/the library's code
    • [x] To fix an existing bug
    • [ ] To resolve #ISSUENUMBER

    This is:

    • [ ] A breaking change
    bug 
    opened by Damego 0
  • refactor!: Change type of permissions attrs to `Permissions`

    refactor!: Change type of permissions attrs to `Permissions`

    About

    This pull request changes the type of permissions attribute of the most dataclasses to Permissions type. Case when you can't change perms for Overwrite Additionally fixes wrong check for type parameter in Channel.add_permission_overwrite.

    Checklist

    • [x] The pre-commit code linter has been run over all edited files to ensure the code is linted.
    • [x] I've ensured the change(s) work on 3.8.6 and higher.

    I've made this pull request: (check all that apply)

    • [ ] For the documentation
    • [ ] To add a new feature
    • [x] As a general enhancement
    • [x] As a refactor of the library/the library's code
    • [x] To fix an existing bug
    • [ ] To resolve #ISSUENUMBER

    This is:

    • [x] A breaking change
    bug enhancement 
    opened by Damego 2
  • feat: Add support for age-restricted commands

    feat: Add support for age-restricted commands

    About

    Title.

    Checklist

    • [x] The pre-commit code linter has been run over all edited files to ensure the code is linted.
    • [x] I've ensured the change(s) work on 3.8.6 and higher.

    I've made this pull request: (check all that apply)

    • [ ] For the documentation
    • [x] To add a new feature
    • [x] As a general enhancement
    • [ ] As a refactor of the library/the library's code
    • [ ] To fix an existing bug
    • [ ] To resolve #ISSUENUMBER

    This is:

    • [ ] A breaking change
    enhancement 
    opened by Damego 0
  • feat: Add helpers for role connection

    feat: Add helpers for role connection

    About

    This pull request implements helper methods for new role connection feature.

    Checklist

    • [x] The pre-commit code linter has been run over all edited files to ensure the code is linted.
    • [x] I've ensured the change(s) work on 3.8.6 and higher.

    I've made this pull request: (check all that apply)

    • [ ] For the documentation
    • [x] To add a new feature
    • [ ] As a general enhancement
    • [ ] As a refactor of the library/the library's code
    • [ ] To fix an existing bug
    • [ ] To resolve #ISSUENUMBER

    This is:

    • [ ] A breaking change
    enhancement 
    opened by Damego 0
  • feat: Implement own `IntEnum` & `StrEnum`

    feat: Implement own `IntEnum` & `StrEnum`

    About

    There are cases when unknown enum value brokes whole bot.

    For example:

    Websocket have raised an exception, closing.
    Traceback (most recent call last):
      File "D:\python_gh\discord_bots\ipy_bot\venv\Lib\site-packages\interactions\client\bot.py", line 479, in _login
        await self._websocket.run()
      File "D:\python_gh\discord_bots\ipy_bot\venv\Lib\site-packages\interactions\api\gateway\client.py", line 304, in run
        await self._handle_stream(msg)
      File "D:\python_gh\discord_bots\ipy_bot\venv\Lib\site-packages\interactions\api\gateway\client.py", line 356, in _handle_stream
        self._dispatch_event(event, data)
      File "D:\python_gh\discord_bots\ipy_bot\venv\Lib\site-packages\interactions\api\gateway\client.py", line 374, in _dispatch_event
        self._dispatch_discord_event(event, data)
      File "D:\python_gh\discord_bots\ipy_bot\venv\Lib\site-packages\interactions\api\gateway\client.py", line 493, in _dispatch_discord_event
        obj = model(**data)
              ^^^^^^^^^^^^^
      File "D:\python_gh\discord_bots\ipy_bot\venv\Lib\site-packages\interactions\utils\attrs_utils.py", line 144, in __init__
        super().__init__(**kwargs)
      File "D:\python_gh\discord_bots\ipy_bot\venv\Lib\site-packages\interactions\utils\attrs_utils.py", line 80, in __init__
        self.__attrs_init__(**passed_kwargs)  # type: ignore
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<attrs generated init interactions.api.models.message.Message>", line 21, in __attrs_init__
        self.type = __attr_converter_type(type)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "D:\python_gh\discord_bots\ipy_bot\venv\Lib\site-packages\attr\converters.py", line 39, in optional_converter
        return converter(val)
               ^^^^^^^^^^^^^^
      File "D:\python_gh\discord_bots\ipy_bot\venv\Lib\site-packages\interactions\utils\attrs_utils.py", line 205, in inner_convert_object
        return value if isinstance(value, type_) else type_(value)
                                                      ^^^^^^^^^^^^
      File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\enum.py", line 695, in __call__
        return cls.__new__(cls, value)
               ^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\enum.py", line 1111, in __new__
        raise ve_exc
    ValueError: 0 is not a valid MessageType
    
    Process finished with exit code 0
    

    This pr fixes this error by implementing own enum for int and str types and adding _missing_ method for catching unknown values.

    Code:

    @client.event
    async def on_message_create(message: interactions.Message):
        print(message.type, type(message.type))
    

    Result:

    MessageType.UNKNOWN: 0 <enum 'MessageType'>
    

    Checklist

    • [x] The pre-commit code linter has been run over all edited files to ensure the code is linted.
    • [x] I've ensured the change(s) work on 3.8.6 and higher.

    I've made this pull request: (check all that apply)

    • [ ] For the documentation
    • [x] To add a new feature
    • [ ] As a general enhancement
    • [ ] As a refactor of the library/the library's code
    • [x] To fix an existing bug
    • [ ] To resolve #ISSUENUMBER

    This is:

    • [ ] A breaking change
    bug enhancement 
    opened by Damego 0
Releases(4.4.0-beta.1)
Owner
james
"King" of interactions. I like to wear different hats for parties. fl0w#0001
james
Algorithmic Trading using RNN

Deep-Trading This an implementation adapted from Rachnog Neural networks for algorithmic trading. Part One — Simple time series forecasting and this c

Hazem Nomer 29 Sep 04, 2022
Adaptation through prediction: multisensory active inference torque control

Adaptation through prediction: multisensory active inference torque control Submitted to IEEE Transactions on Cognitive and Developmental Systems Abst

Cristian Meo 1 Nov 07, 2022
Pseudo lidar - (CVPR 2019) Pseudo-LiDAR from Visual Depth Estimation: Bridging the Gap in 3D Object Detection for Autonomous Driving

Pseudo-LiDAR from Visual Depth Estimation: Bridging the Gap in 3D Object Detection for Autonomous Driving This paper has been accpeted by Conference o

Yan Wang 881 Dec 27, 2022
ML powered analytics engine for outlier detection and root cause analysis.

Website • Docs • Blog • LinkedIn • Community Slack ML powered analytics engine for outlier detection and root cause analysis ✨ What is Chaos Genius? C

Chaos Genius 523 Jan 04, 2023
Graph Convolutional Neural Networks with Data-driven Graph Filter (GCNN-DDGF)

Graph Convolutional Gated Recurrent Neural Network (GCGRNN) Improved from Graph Convolutional Neural Networks with Data-driven Graph Filter (GCNN-DDGF

Lei Lin 21 Dec 18, 2022
Use graph-based analysis to re-classify stocks and to improve Markowitz portfolio optimization

Dynamic Stock Industrial Classification Use graph-based analysis to re-classify stocks and experiment different re-classification methodologies to imp

Sheng Yang 10 Dec 05, 2022
A Pytorch implementation of CVPR 2021 paper "RSG: A Simple but Effective Module for Learning Imbalanced Datasets"

RSG: A Simple but Effective Module for Learning Imbalanced Datasets (CVPR 2021) A Pytorch implementation of our CVPR 2021 paper "RSG: A Simple but Eff

120 Dec 12, 2022
Official code of CVPR 2021's PLOP: Learning without Forgetting for Continual Semantic Segmentation

PLOP: Learning without Forgetting for Continual Semantic Segmentation This repository contains all of our code. It is a modified version of Cermelli e

Arthur Douillard 116 Dec 14, 2022
Code for the paper: On Pathologies in KL-Regularized Reinforcement Learning from Expert Demonstrations

Non-Parametric Prior Actor-Critic (N-PPAC) This repository contains the code for On Pathologies in KL-Regularized Reinforcement Learning from Expert D

Cong Lu 5 May 13, 2022
Overview of architecture and implementation of TEDS-Net, as described in MICCAI 2021: "TEDS-Net: Enforcing Diffeomorphisms in Spatial Transformers to Guarantee TopologyPreservation in Segmentations"

TEDS-Net Overview of architecture and implementation of TEDS-Net, as described in MICCAI 2021: "TEDS-Net: Enforcing Diffeomorphisms in Spatial Transfo

Madeleine K Wyburd 14 Jan 04, 2023
Implementation of the paper: "SinGAN: Learning a Generative Model from a Single Natural Image"

SinGAN This is an unofficial implementation of SinGAN from someone who's been sitting right next to SinGAN's creator for almost five years. Please ref

35 Nov 10, 2022
A script helps the user to update Linux and Mac systems through the terminal

Description This script helps the user to update Linux and Mac systems through the terminal. All the user has to install some requirements and then ru

Roxcoder 2 Jan 23, 2022
Wider-Yolo Kütüphanesi ile Yüz Tespit Uygulamanı Yap

WIDER-YOLO : Yüz Tespit Uygulaması Yap Wider-Yolo Kütüphanesinin Kullanımı 1. Wider Face Veri Setini İndir Train Dataset Val Dataset Test Dataset Not:

Kadir Nar 6 Aug 22, 2022
Homepage of paper: Paint Transformer: Feed Forward Neural Painting with Stroke Prediction, ICCV 2021.

Paint Transformer: Feed Forward Neural Painting with Stroke Prediction [Paper] [PaddlePaddle Implementation] Homepage of paper: Paint Transformer: Fee

442 Dec 16, 2022
Production First and Production Ready End-to-End Speech Recognition Toolkit

WeNet 中文版 Discussions | Docs | Papers | Runtime (x86) | Runtime (android) | Pretrained Models We share neural Net together. The main motivation of WeN

2.7k Jan 04, 2023
Implementation EfficientDet: Scalable and Efficient Object Detection in PyTorch

Implementation EfficientDet: Scalable and Efficient Object Detection in PyTorch

tonne 1.4k Dec 29, 2022
Adabelief-Optimizer - Repository for NeurIPS 2020 Spotlight "AdaBelief Optimizer: Adapting stepsizes by the belief in observed gradients"

AdaBelief Optimizer NeurIPS 2020 Spotlight, trains fast as Adam, generalizes well as SGD, and is stable to train GANs. Release of package We have rele

Juntang Zhuang 998 Dec 29, 2022
A multilingual version of MS MARCO passage ranking dataset

mMARCO A multilingual version of MS MARCO passage ranking dataset This repository presents a neural machine translation-based method for translating t

75 Dec 27, 2022
Official Pytorch Implementation of: "ImageNet-21K Pretraining for the Masses"(2021) paper

ImageNet-21K Pretraining for the Masses Paper | Pretrained models Official PyTorch Implementation Tal Ridnik, Emanuel Ben-Baruch, Asaf Noy, Lihi Zelni

574 Jan 02, 2023
Which Style Makes Me Attractive? Interpretable Control Discovery and Counterfactual Explanation on StyleGAN

Interpretable Control Exploration and Counterfactual Explanation (ICE) on StyleGAN Which Style Makes Me Attractive? Interpretable Control Discovery an

Bo Li 11 Dec 01, 2022