Quantcast
Browsing all 13981 articles
Browse latest View live

Image transformer model for image inpainting not converging on FashionMNIST

I am trying to do an image inpainting task using a transformer model. I randomly mask out some pixels in an image (setting the corresponding positions to 0), then divide it into patches like ViT does....

View Article


How can i access detail of a file in Google Drive?

How can i access detail of a file in Google Drive ? ?Example:from google.colab import drivefrom glob import globdrive.mount('/content/gdrive')images=glob(r'/content/gdrive/My Drive/img/*')I would like...

View Article


showing name of a certain class rather than object [duplicate]

if I have a class of students and I wanted a method that printed they were failing when their grade went below 60 how would I get it to show the name of the specific student rather than the object...

View Article

How to make this regex pattern 'dynamic' for unknown repitition of instances

I have a line of text where I'm matching names:193 ARMSTRONG Carol ARMSTRONG Ronald ARMSTRONG DaveTo separate name substrings like: ARMSTRONG Ronald or ARMSTRONG Dave I am using the regex:pattern =...

View Article

Choosing a PIL.ImageFont by font name rather than filename, and...

ImageFont.truetype requires a filename to work, such as:font = ImageFont.truetype("ariblk.ttf") # Arial BlackIs there a way with PIL, to load a font by name, rather than filename?Context: I would like...

View Article


I want to make a decoder from the encoder in python [closed]

They gave me an encoder and I'm trying to get it to decode as well. The code is written in Python, I tried to make some progress but I got stuck and can't get out of it:this is the decoder code:import...

View Article

Longest substring without repeating characters in python

This is a pretty standard interview question. Find the longest substring without repeating characters. Here are the test cases,abcabcbb -> 3bbbbb -> 1pwwkew -> 3bpfbhmipx -> 7tmmzuxt ->...

View Article

Which approach is the best and fastest for video conversion from x (MOV, AVI...

At the moment, I am using ffmpeg library to convert videos from x type (MOV, AVI etc) to dedicated type i.e. MP4. But it is taking too long time for video conversion. Lets say the MOV video size is...

View Article


Return multiple values in Django Class-based View

I am working on a project for a Django course I am taking but currently struggling a bit with views.In the project I created a View using ListView to display a list of products in my template. By using...

View Article


How can I transform repeated data from dataframe into single dictionary?

I'm new to python and I'm trying to get accustomed to it.Basically, I have an excel file with student info and I read it into python using pandas. It looks something like...

View Article

How to decode string address into Pubkey address on Solana

I am querying data from raydium using their SDK, but i am trying to do it in Python instead.So, I am obtaining an address:<BN: b870e12dd379891561d2e9fa8f26431834eb736f2f24fc2a2a4dff1fd5dca4df>And...

View Article

Is it possible to statically wrap/derive a parameter from another paramerter...

I often run into situations where I want to train a parameter, but that parameter only gets used by the model in a transformed form. For example, think of a simple scalar parameter defined on (-∞, +∞),...

View Article

Issue with Updating Attendance Records in Django using MySQL

I am encountering an issue with updating attendance records in my Django application using MySQL. I have a handle_attendance_record function intended to update or create an AttendanceRecord for an...

View Article


how to fix FIxed effect model?

"The index on the time dimension must be either numeric or date-like" This mistake appears when i try to set up fixed effect within model and random effect model.Ive got a panel data which contain year...

View Article

Does Python still print a trailing newline after printing the contents of a...

Disclaimer: I know I essentially answer my own question, but please humor me anyway.I'm working through a Python book I have (Python Crash Course 2nd Edition), and it says, "The only difference between...

View Article


Show only certain items in legend

I currently am plotting a stacked bar graph of a large amount of taxonomic data, and only wish to show significant species in the legend (out of ~500 I wish to show ~25). Is there a simple way to do...

View Article

How to connect to Google Cloud PostgreSQL database from Cloud Functions?

I was following the Connecting to Cloud SQL with Cloud Functions tutorial but my Cloud Function won't connect to the PostgreSQL database.Here's my function code:import sqlalchemyconnection_name =...

View Article


CSS Notation for a Scrapy Spider Script

I wrote the below python script to return the item name, price, and link for items listed on https://shop.doverstreetmarket.com/collections/shops-noahimport scrapyclass DSMUKSpider(scrapy.Spider):name...

View Article

JSON Pickle serialize object list

I want to serialize a list of object using jsonpickle. Each of these objects contain a list of object within them:class ImageManipulationConfiguration: region_list = [] def to_json(self): return...

View Article

Replace import statement and method call in a string

I have a string in Python representing some code, and I want to replace the import statement for time with the corresponding from time import sleep if the code contains a method call like time.sleep()....

View Article
Browsing all 13981 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>